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
Lovely LopezLovely Lopez 

How to update a person account field when the field on the contact record of the person account changed?

We have a checkbox called Web View and it automatically updates based on contact ID. I created a trigger that updates the checkbox in the account whenever there is a contact that has that checkbox checked. That works perfectly when the account is not a person account and has one or more contacts but it doesn't work when it comes to person account. I understand that a person account has an equivalent contact record for it. I would like the Web View checkbox in the account to be updated also whenever the Web View checkbox in the contact record of that person account is updated (I hope I'm making sense). What is the best way to do this? 
Best Answer chosen by Lovely Lopez
Lovely LopezLovely Lopez
I found the solution for this. I want to share it to those who might encounter the same issue in the future.

I found out that the checkbox in the person account can be automatically updated to match it with the contact record checkbox of the person account once the contact checkbox has been updated through workflow rule. There is really no need for a trigger for this. Just set up the criteria on how you want it. So for example in my case my criteria are: if the contact View checkbox equals to true and if IsPersonAccount equals to true then workflow rule will be account View checkbox equals to true. Then I created another rule for the if checkbox equals to false.

If you're wondering where to find the contact fields for person account or what you see as fields with __pc in formulas, it will show up in the dropdown list when you're creating the workflow rule. Just make sure you know which one it is since it will only show you the field name not the one with __pc.

All Answers

ShashForceShashForce
Hi,

Unfortunately, this is working as designed. You may have to write a separate trigger with Person accounts in mind. Please see if this helps: http://salesforce.stackexchange.com/questions/1209/is-there-any-way-to-invoke-contact-triggers-on-a-person-account

Thanks,
Shashank
Lovely LopezLovely Lopez
I found the solution for this. I want to share it to those who might encounter the same issue in the future.

I found out that the checkbox in the person account can be automatically updated to match it with the contact record checkbox of the person account once the contact checkbox has been updated through workflow rule. There is really no need for a trigger for this. Just set up the criteria on how you want it. So for example in my case my criteria are: if the contact View checkbox equals to true and if IsPersonAccount equals to true then workflow rule will be account View checkbox equals to true. Then I created another rule for the if checkbox equals to false.

If you're wondering where to find the contact fields for person account or what you see as fields with __pc in formulas, it will show up in the dropdown list when you're creating the workflow rule. Just make sure you know which one it is since it will only show you the field name not the one with __pc.
This was selected as the best answer