---
schema_version: "1"
id: c7942c0898a5899f0c3a75cfd261f866b29e582d955a36b074c09ca318f60887
title: EnvironmentContext Methods
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_canvas_EnvironmentContext_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c36dad155c6e935da41dd32e517bfe4b1cbbe63b49f1df7991d8dac14c32a45c
---
# EnvironmentContext Methods

The following are methods for EnvironmentContext.

- **[addEntityField(fieldName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_addEntityField.htm)**  
    Adds a field to the list of object fields that are returned in the signed request Record object when the component appears on a Visualforce page that’s placed on an object.
- **[addEntityFields(fieldNames)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_addEntityFields.htm)**  
    Adds a set of fields to the list of object fields that are returned in the signed request Record object when the component appears on a Visualforce page that’s placed on an object.
- **[getDisplayLocation()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getDisplayLocation.htm)**  
    Retrieves the display location where the canvas app is being called from. For example, a value of Visualforce page.
- **[getEntityFields()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getEntityFields.htm)**  
    Retrieves the list of object fields that are returned in the signed request Record object when the component appears on a Visualforce page that’s placed on an object.
- **[getLocationUrl()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getLocationUrl.htm)**  
    Retrieves the location URL of the canvas app.
- **[getParametersAsJSON()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getParametersAsJSON.htm)**  
    Retrieves the current custom parameters for the canvas app. Parameters are returned as a JSON string.
- **[getSublocation()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_getSublocation.htm)**  
    Retrieves the display sublocation where the canvas app is being called from.
- **[setParametersAsJSON(jsonString)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_canvas_EnvironmentContext_setParametersAsJSON.htm)**  
    Sets the custom parameters for the canvas app.