Goal:
Let’s consider that I’m conducting a WIT Meetup on 5th Dec, 2016. So, I need the attendees list coming for this meetup in PDF format.
I have created an Account in Salesforce as “Salesforce Mumbai WIT Meetup”. And created an Event with Subject as “December WIT Meetup” and all attendees will be listed on “Name” field on Event.
Event detail page:
Note: You’ve to Enable Multiple Contacts on Activity Settings
Creating DDP: I’ve created a DDP as ‘Attendees on Event’ on Account. Created 2 Relationship records for fetching Earliest Event associated with Account and for fetching Contact’s details from Event.
- Earliest Event on Account: For fetching earliest and not completed event, I’ve given filter condition as per below screenshot
- Pulling Contacts from Event: In SFDC, values on ‘Name’ field, it can be Contacts/Leads can be queried by using “Event Relations” object.
- Created a Relationship by selecting relation type as “SOQL”
- Firstly, fetching all Contacts i.e., RelationID from Event (Event queried from the above screenshot)
- Secondly, fetching Contact details by using Inner Query as per below screenshot
DDP Template:
Now, we got all relationships associated with DDP and will be preparing the DDP Template by using Field Tagger as per below screenshot. Prefixing <<C1_Start>> field tagger for Row Replication to display more than 1 Contact associated with Event.
Running DDP:
All is Set now, I’m navigating to ‘Salesforce Mumbai WIT Meetup’ Account detail page and clicking on “Generate Documents” DDP button. Then click on Run button.