public List<String> getEntityFields()
Type: LIST<String>
When you use the <apex:canvasApp> component to display a canvas app on a Visualforce page, and that page is associated with an object (placed on the page layout, for example), you can specify fields to be returned from the related object. See the Canvas Developer Guide for more information on the Record object.
Use getEntityFields() to retrieve the list of object fields that are returned in the signed request Record object. By default the list of fields includes ID. The list of fields can be configured by using the Canvas.EnvironmentContext.addEntityField(fieldName) or Canvas.EnvironmentContext.addEntityFields(fieldNames) methods.
This example gets the current list of object fields and retrieves each item in the list, printing each field name to the debug log.
Canvas.EnvironmentContext env = renderContext.getEnvironmentContext(); List<String> entityFields = env.getEntityFields(); for (String fieldVal : entityFields) { System.debug('Environment Context entityField: ' + fieldVal); }
Environment Context entityField: Id