What are Related Records in Salesforce?
Related records in Salesforce CRM refer to records that are connected or linked to another record. For instance, in Salesforce CRM, an Account record can have multiple Contacts associated with it. This association allows for convenient access and organization of data within the CRM system.
By creating a table of related records in Viewer, you can conveniently display and manage related data in a structured format.
How to Create Data Item for Related Records
Before adding a table of related records, you need to create a data item under your Template.
Follow these steps:
- Go to Viewer Administrator , require Setup and Template
- Click on "Create Data Item"
- Fill the form
- Object Api Name : Choose the related object from the drop-down list .
- UnCheck "Single Record"
- make sue to set "Relationship Type" as "Related List"
- Select you Filter : this is the connection between the primary object and the related list
- Once you "Submit" the screen will be update
- Select the desired fields you want to display in the table.
Once you have created the data item, you can proceed to the next step of adding the table to your Word template.
How to Add the Table to My Word Template
Viewer tables are fully customized and will display the data base on the Data Item records. You will see only 1 Row with tags in the Table PlaceHolder - this is OK ๐
To add table of related records to Word template, follow these steps:
- Click on "Get Tags"
- Reorder the table
- Click "Copy Table" in order to copy to your clipboard
- Open your Word template in your local office
- Paste the table that you copy before
- Style your table
- Save the changes to your Word template.
- Update you file template to salesforce saved template
Once you have completed these steps, the table of related records will be displayed in the Viewer of your Word template.
How to remove Empty Table ?
In case we have empty table we can use isTruthy operator before the table to check if the related records variable is empty.
For example :
{{#isTruthy Lines }}
Youe Table Will Be Here
{{/isTruthy }}
