Newer Version Available
getParametersAsJSON()
Retrieves the current custom parameters for the canvas app. Parameters are returned
as a JSON string.
Signature
public String getParametersAsJSON()
Return Value
Type: String
Usage
Use this method to get the current custom parameters for the canvas app. The parameters are returned in a JSON string that can be de-serialized by using the System.JSON.deserializeUntyped(jsonString) method.
Custom parameters can be modified by using the Canvas.EnvironmentContext.setParametersAsJSON(jsonString) string.
Example
This example gets the current custom parameters, de-serializes them into a map, and prints the results to the debug log.
1Canvas.EnvironmentContext env = renderContext.getEnvironmentContext();
2
3// Get current custom params
4Map<String, Object> currentParams =
5 (Map<String, Object>) JSON.deserializeUntyped(env.getParametersAsJSON());
6System.debug('Environment Context custom paramters: ' + currentParams);