---
schema_version: "1"
id: e8211aee79f830a010a18fd896a0b2f726bb8e33e5cbf6fe5100741d38e8cdb6
title: onRender(renderContext)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_CanvasLifecycleHandler_onRender.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_CanvasLifecycleHandler_onRender.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 591695dc714fb374ea5a5f82741c204ea09836d86f58c85856b632564089ad5c
description: 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.
---
# 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

- **renderContext**:
    
    Type: [Canvas.RenderContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_canvas_RenderContext.htm "A wrapper interface that is used to retrieve application and environment context information.")

## 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](https://developer.salesforce.com/docs/atlas.en-us.264.0.platform_connect.meta/platform_connect/ "HTML (New Window)") 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.

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

#### See Also

- [_Canvas Developer Guide_: Controlling App Behavior](https://developer.salesforce.com/docs/atlas.en-us.264.0.platform_connect.meta/platform_connect/canvas_controlling_app_behavior.htm "Canvas Developer Guide: Controlling App
    Behavior - HTML (New Window)")