Skip to main content
Skip table of contents

record

Retrieves values of specified fields of a single Salesforce record and stores the data into the variablecontext as a Data item.

A common companion of record is relatedList, which offers another relatively simple data retrieval interface. If more complex or efficient data queries areneeded, the query command offers the use of freely defined SOQL queries.

Attributes

var

Required

Value type

EL-evaluated

Yes

String

No

Name of the variable that holds the Data item.

type

Required

Value type

EL-evaluated

Yes

String

Yes

The resolved value of this attribute should be the API name ofthe target record's object type. 

recordID

Required

Value type

EL-evaluated

Yes

String

Yes

Defines the ID of the record whose data is to be retrieved.

fields

Required

Value type

EL-evaluated

Yes

String

No

Defines the fields whose values are retrieved. The resolvedString should be a comma-separated list of the fields' API names, eg. "Id, Name,Quantity".

If the resolved set of fields contains names of fields that don't exist orotherwise cannot be retrieved, the command will still succeed but the Data item will not containentries for the "invalid" fields. A warning listing these "invalid" fields is also produced. 

mainRecord

Required

Value type

EL-evaluated

No

Boolean

No

If the value of this attribute is true, the objectnamed in the type attribute is set as the main object of the template. If thedocument's logic, such as queries, require a record of a particular object type to be externallyspecified, that object type should be the main object.

If more than one recordcommand has this attribute set as true, the command that is evaluated last sets themain object.

The default value of this attribute is false.

Examples

Use the record command when you need to get data of a single record whose Id is known.

CODE
<record var="mainOpp" type="Opportunity" recordID="${id}" fields="Name, CloseDate, Amount, Description">
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.