-1

I observed that when creating a Contact from an Account's Contact's related list, it's automatically set as isDirect=True (easier to see this when viewing an Account record in Salesforce Classic). The end goal is from all the related contacts, I only want 1 record to be isDirect = true.

How can I achieve this?

1 Answer 1

0

You can't really stop this from happening.

The isDirect standard checkbox on ACR (AccountContactRelation) is controlled by the AccountId field on the Contact. If the ACR points to the same Account as the Contact does, then it's a direct Contact.

When you're creating a new Contact from the related list on Account, it's naturally going to be related to that Account. When you have ACRs enabled (via the "allow contacts to be related to multiple Accounts" feature), setting the AccountId on a Contact will also automatically create an ACR.

If you don't have the AccountId populated on a Contact, then it's a "private contact" and you can't create any ACR records to relate it to other accounts (until you set the AccountId on the Contact, making it no longer "private").

So I think your only options here are:

  • Update the AccountId on the Contact to point it to some other Account (manually or via trigger)
  • Create your own custom field that you're able to control (also requiring a trigger or flow to enforce your rule)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .