Skip to main content
I created a flow and process builder when a Contact is added to an account, number "1" will be added to the Number_of_Contacts__c number field in Accounts. I created these features based on this website - https://www.xgeek.net/salesforce/create-roll-up-summary-field-to-count-contacts-on-account-with-process-builder-and-flows/ 

 

Also when the Contact is deleted, number "1" will be subtracted from the  Number_of_Contacts__c  field in Accounts. 

 

However here is the issue I am experiencing, when I reassign a contact from one account to another account, the Number_of_Contacts__c  field values in the original account does not update. 

 

For example, if I add Contact A to Account A, the Number_of_Contacts__c  field = "1" . When I remove Contact A from Account A and add it to Account B, Account A Number_of_Contacts__c  field still = "1". It should remain blank. 

 

Is there a way to resolve this issue?

 

If there is a way to solve this issue without using Apex coding?

 

 If the solution is to use Apex, does anyone have an example of using anApex Trigger and an Apex Class?

 

 
4 answers
0/9000