Record Criteria
Overview
Record Criteria are used to determine which records to use from the selected object of the Data Set. Because the Contact and Application are the most common objects to use, below is how to set the criteria in two Data Sets so that each Community user sees their own contact record and active application(s).
The Contact Data Set
Object: Contact (be sure to choose the “Active Application record” if the page also needs application information)
- Criteria Field: Contact ID (id)
- Operator: equals
- Value Type: Global Variable
- Value: CurrentContactID Note:CurrentContactID is a special value that is automatically set to the ID of the Contact record of the current user.
The Application Data Set
Object: Application
- Criteria Field: Record ID (Id)
- Operator: equals
- Value Type: Data Set
- Data Set: choose the Contact data set that you defined, above
- Value: Active Application Record
Child Object Data Set
To create a Data Set that retrieves child records of the Application (e.g., Education History, Test Score, Recommendation, etc.), use as criteria the field that looks up to the Application. Choose the Value Type of Data Set and then the Data Set that has the Application information. The Value will be the ID of the Application, for example:
Object: Education History
- Criteria Field: Application
- Operator: Equals
- Value Type: Data Set
- Data Set: Choose the Application Data Set you defined, above in (2.)
- Value: Record ID (the Salesforce unique ID of the Application)
Data Set Record Criteria for Sites
Because Sites are public pages, the user is anonymous and there is no
CurrentContactID when the page is accessed. Sites pages must therefore include one
or more parameters in their URLs to uniquely identify the record to be shown and
updated by the site. When configuring a Site page, at least one Data Set must use a
parameter. The Data Set that uses the parameter should be the one that needs to be
uniquely identified for use in the Site. Other Data Sets can then be configured to
reference this primary one. The following URL shows an example of parameters:
http://formbuilder.force.com/FormBuilderSite?name=ERx&type=test
In this example, “name” and “type” are parameters. The value of “ERx” is passed to the “name” parameter, and the value of “test” is passed to the “type” parameter. Parameters always follow the question mark (?) in a URL. Parameters are separated by an ampersand (&).
To configure the parameter, edit the Data Set and scroll to Record Criteria(s) and use these values:
- Criteria Field: Record ID, or other field that uniquely identifies the record
- Operator: equals
- Value Type: Param
- Data Set: This remains blank
- Value: This will be a text value that is the name of the parameter, as in “name” or “type” above. Since the value that will be passed to a parameter is often a record ID, it may help you to name your parameter with the name of the object it references, such as “recommendationID” or “workHistoryID”.