Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

onRender(renderContext)

Invoked when a canvas app is rendered. Provides the ability to set and retrieve canvas application and environment context information during the application render phase.

Signature

public void onRender(Canvas.RenderContext renderContext)

Parameters

Return Value

Type: Void

Usage

If implemented, this method is called whenever the canvas app is rendered. The implementation can set and retrieve context information by using the provided Canvas.RenderContext.

This method is called whenever signed request or context information is retrieved by the client. See the Canvas Developer Guide for more information on signed request authentication.

Example

This example implementation prints ‘Canvas lifecycle called.’ to the debug log when the canvas app is rendered.

1public void onRender(Canvas.RenderContext renderContext) {
2    System.debug('Canvas lifecycle called.');
3}