You need to sign in to do that
Don't have an account?
Kacy Coates
Create New Related Email object on Contact Record with trigger
I'm new to writing Apex triggers, and I'm not really sure where to start, so I'm hoping someone can help me. We currently have a trigger as part of our managed package that creates a new record for an Object called Related Address when you update the address field on a contact record.
I would basically like to copy this trigger for our email address field on the contact. Because it's part of our managed package, I can't view what the Trigger coding is to just mimick it myself. We already have the Related Email object created, so now I just need to figure out how to format the Trigger. Can anybody advise me on a trigger to do this? I would be much appreciated!
I would basically like to copy this trigger for our email address field on the contact. Because it's part of our managed package, I can't view what the Trigger coding is to just mimick it myself. We already have the Related Email object created, so now I just need to figure out how to format the Trigger. Can anybody advise me on a trigger to do this? I would be much appreciated!
I dont think you can get the code from the managed package except from the developer.
You can write an update trigger on Contact object:
The code is obviously not tested, and I have also skipped the variable declarations. This is just to give you some idea of how the code works. Go through the link to understand more: https://trailhead.salesforce.com/en/content/learn/modules/apex_triggers/apex_triggers_intro
Give it a shot, you will learn. Post the code here if you face errors.
Hope this helps.
Thanks and Regards,
Neha
www.initaura.com - Everything Salesforce (https://initaura.com)
I have gone through your question. Create a new record on the update of the email address field.
Please go through the code given below:-
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com