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
Robbie NixonRobbie Nixon 

How to specify which contact to use from related contacts on account

I have 2 contacts with role economic buyer related to an account. I want to use the contacts last names as part of a naming convention for an opportunity, eg, Smith & Lee.

I can get the last name from contact 1, but is there a way of using the last name of contact 2, 3, etc as well?

Thanks, Robbie
Boss CoffeeBoss Coffee
How are you currently fetching the Last Name from Contact 1?
Robbie NixonRobbie Nixon
I'm getting contact 1 last name via Account contact relationship > Contact ID > Last Name.

This always points to the contact listed first though. If I repeat the syntax it gets Contact 1 again, so the result is Smith & Smith, not Smith & Lee.

If contacts are set up as follows:
Contact 1 = John Smith
Contact 2 = Ken Lee

I would like to get Smith & Lee.
Boss CoffeeBoss Coffee
Are you currently using apex code to fetch the contact's last name? I'm asking for clarity so I know whether or not I can just update your current method or if I need to introduce a completely new course of action.
Robbie NixonRobbie Nixon
Hi, I've been using process builder. I'm new to salesforce to still working things out. I was also thinking about how a flow might do the job. Thanks
Boss CoffeeBoss Coffee
Would you mind showing the logic on pulling the contact last name in the process builder?