function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gaurav Agrawal 1Gaurav Agrawal 1 

Multiple Lookup for contact and for a custom object named closing contact on a Visualforce page

I need to have two lookups for contact and two lookup for a custom object, so that i can send email to them on sendEmail button action. I am stuck at how to fetch multiple id's of lookup in controller and send the mail.
Best Answer chosen by Gaurav Agrawal 1
option 1 (bad): create two different fields and retrieve each one
Option 2 (better but more work): create a junction object linking the contact and the object, retreive records from the junciton object linked to the contact in one SoQL query to a set. check how account or opportunity ocntact roles are retreived in SoQL as an example