You need to sign in to do that
Don't have an account?
Lovely Lopez
Update checkbox in Account to true if one of the Contacts have the checkbox set to true
I have a checkbox named Views in Contact and Account. I would like the checkbox in Account to be checked if one of the Contacts have that checkbox checked. I know about the cross object formula but that only seem to work from Parent to Child object not the other way around. Is there any way to do this except for creating a trigger? If the trigger is only the solution, can you give me an idea what to do? I'm not very familiar with trigger yet. I would need help with this. Thank you!
All Answers
Trigger is the only solution in this case. You can read the documentation about triggers here and since you have a easy use-case, it should not be very difficult to code these triggers.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers.htm
Also please take a look at the following step-by-step tutorial on how to write triggers:
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_HelloWorld.htm
Did it work for you ?
If yes, could you mark the Best Anwser?
If no, feel free to ask more questions.
Thanks.
Apex trigger UpdateViews caused an unexpected exception, contact your administrator: UpdateViews: execution of AfterUpdate caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Contact.AccountId: Trigger.UpdateViews: line 27, column 1