[SalesForce] Process to update parent account when child record changes

I have to update a Contact lookup field (Current_PC__c) in Account object when a field (National_Member_Primary__c) in Contact object changes. I have created a process for this however it is not updating the fields, screenshots of the process are below. Can someone please help me with this on what I might be doing wrong, or if this is even possible?

  1. Process is on Contact object:
    enter image description here

  2. Criteria for the action group: when all of the below conditions are met. Contact.National_Primary_Contact__c (Boolean type field) is TRUE AND Contact.Organization_Name_Formula__c (Formula type field) IS NOT NULL
    Formula for Contact.Organization_Name_Formula__c is Account.Name

  3. Update Records:
    Current_PC__c (lookup field in Account) = Contact.Contact_Full_Name
    enter image description here

Edits made: I have made few changes to the step 3 and the record type to be updated looks like this now:
Record type – [Contact].Organization Name.Account Manager.Account ID
Record to be updated – Current_PC__c field reference Contact.ID
enter image description here

Best Answer

It's important to make a distinction here between the Name and the Id of a record. These two values are not interchangeable. Any time you have a lookup field connecting one object to another, the value that goes in that lookup field must be an Id. Putting a non-Id value in a lookup field will cause an exception.

Similarly, if you want to check whether a lookup field is populated, you can just look at it directly by asking whether the field is null. You don't need to look at a Name-based formula field.

If you change your Process to exclusively use Id values, I think you're most of the way there. You'd change your second criterion to look for AccountId not equal to null, and your record update would populate the Contact Id in the field Current_PC__c (no need for a formula).

The other issue I see in the screenshots you posted is that you're trying to update related Accounts through a custom relationship Accounts__r, and that may not be what you want here. You can just update the Contact's Account through the standard Account relationship, unless your org is using an unusual Account structure or AccountContactRelation objects.

Related Topic