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
RishuRishu 

Flow to update Primary Contact field from true to false on any contact

Hi Team,
I have requirement to update Primary Contact using Record Based Trigger.

The flow should update the Primary Contact field from "true" to "false" on a contact record if another Contact record related to an account is edited with Primary Contact field equals to true.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rishu,

Can you confirm if my understanding is correct. If we are trying to edit the contact primary contact field from False to true then we need to search all the other contacts for that account and make that field to False.

Thanks,
 
RishuRishu
Hi Praveen,
Yes that's correct

If a contact record where  Primary contact = true exist on account and user tries to edit and existing contact record where Primary contact was set as false and changes the value to 'true'
Then any other contact record associated to Account where Primary Contact = 'true' should change to 'false'
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Rishu,

I have answered the similar question earlier and that solution worked. Can you try implementing the same.

https://developer.salesforce.com/forums?id=9062I000000bmtn

If this solution helps, Please mark it as best answer.

Thanks,