Topic
Instructions
1. Create a new SOQL relationship on your DocGen Package
2. Give the relationship an alias. Be sure it is unique and that it does not match the naming convention of any existing objects or fields in your Salesforce Org.
4. Paste the SOQL Query into the box
5. The example below will pull in all Opportunity Contact Roles:
Primary Object: Opportunity (Opportunity)
Related List Junction Object: Contact Roles (OpportunityContactRole)
Object In Junction Object: Contacts (Contact)
SELECT Contact.name FROM OpportunityContactRole WHERE Opportunity.Id = '<<Opportunity_ID>>'
SELECT lookup_(Object in Junction)api_name.field
FROM junction_object_api_name
WHERE main_object_api_name.id = '<<main_object_record_id_tag>>'
For custom objects, be sure to append __r at the end for dot notated fields.
SELECT lookup_(Object in Junction)api_name__r.field FROM junction_object_api_name WHERE main_object_api_name__r.id = '<<main_object_record_id_tag>>'
Related Links