You need to sign in to do that
Don't have an account?
Trigger to update field across object.
Hi all,
I'm working for a non-profit and new to apex. I'm having a hard time thinking through how to do a SOQL query and update fields inside a trigger.
I have a custom object Application__c which is related to a Contact (field name on application Contact__c) and has a couple fields I want to update from related fields on the Contact. Both fields are lookup relationships so I cannot use workflow.
the two fields are: on application Specific_Organization__c = on Contact Specific_Organization__c
on application Specific_Visit__c = on Contact Specific Visit__c
and this needs to happen if a field on the application Status__c = "Applicant" and one on the contact Alum__c = False.
Any help to get me started in the right direction would be appreciated.
Thanks!
Chris
Hey Chris,
Since you're non-profit, I'll write you the whole trigger! :)
The trigger is not compiled/tested (b/c I don't have your data model), so you'll surely see a few syntax/logical errors, but minor ones. The trigger is bulk-safe.
I hope this helps.
Thanks.
All Answers
Hey Chris,
Since you're non-profit, I'll write you the whole trigger! :)
The trigger is not compiled/tested (b/c I don't have your data model), so you'll surely see a few syntax/logical errors, but minor ones. The trigger is bulk-safe.
I hope this helps.
Thanks.
Thanks a lot! That's exactly what I needed.