Newer Version Available
excludeContextTypes()
Signature
public Set<Canvas.ContextTypeEnum> excludeContextTypes()
Return Value
Type: SET<Canvas.ContextTypeEnum>
- Canvas.ContextTypeEnum.ORGANIZATION
- Canvas.ContextTypeEnum.RECORD_DETAIL
- Canvas.ContextTypeEnum.USER
Usage
Implement this method to specify which attributes to disable in the context of the canvas app. A disabled attribute will set the associated canvas context information to null.
Disabling attributes can help improve performance by reducing the size of the signed request and canvas context. Also, disabled attributes do not need to be retrieved by Salesforce, which further improves performance.
See the Canvas Developer Guide for more information on context information in the Context object that’s provided in the CanvasRequest.
Example
This example implementation specifies that the organization information will be disabled in the canvas context.
1public Set<Canvas.ContextTypeEnum> excludeContextTypes() {
2 Set<Canvas.ContextTypeEnum> excluded = new Set<Canvas.ContextTypeEnum>();
3 excluded.add(Canvas.ContextTypeEnum.ORGANIZATION);
4 return excluded;
5}