You need to sign in to do that
Don't have an account?
Brandon Nelson
APEX Trigger To Update Field Value
APEX Noob here :)
So I found out that I can not use a field of TEXT format when using an EMAIL ALERT. What I did was created a field called "Email" and gave it an EMAIL format. I would like to update this field with the email address based on the name in another field.
Layout:
Case Object: I have a field named: Wealth Planner (This is a lookup field linked on the EMPLOYEES custom object)
Case Object: I have a field named: Email (I would like this field to populate the EMAIL address for Wealth Planner (above) on the EMPLOYEES object)
I just dont know enough APEX to do this yet. Any help????
I hope this make sense.....
So I found out that I can not use a field of TEXT format when using an EMAIL ALERT. What I did was created a field called "Email" and gave it an EMAIL format. I would like to update this field with the email address based on the name in another field.
Layout:
Case Object: I have a field named: Wealth Planner (This is a lookup field linked on the EMPLOYEES custom object)
Case Object: I have a field named: Email (I would like this field to populate the EMAIL address for Wealth Planner (above) on the EMPLOYEES object)
I just dont know enough APEX to do this yet. Any help????
I hope this make sense.....
Hi Brandon,
Please contact me on skype, we will fix the issue together.
Thanks,
Gaurav
Skype: gaurav62990
All Answers
Please create a formula field for "EMAIL" and add formula "wealth_planner__r.email_Address" in this.
Hope this helps!!!
Thanks,
Gaurav
Skype: gaurav62990
Hi Brandon,
Did you tried creating the formula fields as return type "text". Let me know if you still face this issue.
Thanks,
Gaurav
@GauravGarg Yes. I created a formula field with a TEXT output type and for the formula I used (Wealth_PLanner_New_Field__r.Email__c).
That got me the email address, but when I go to create the Email Alert that field does NOT show up so I can't email them.
Brandon,
in this case we can populate Email address in trigger code. Do you have any trigger written over this object?
Thanks,
Gaurav
Something along those lines should do. you can just replace Wealth_Planner_Field_Name__c with the lookup field name, Email__c with the email field on wealth planner, and Email_Field__c with the name of the field on the case object, etc.
Do you think you could walk me through the lines?
Story: On the CASE object I have a field API name: Wealth_PLanner_New_Field__c that is a LOOKUP field on the EMPLOYEES object.
Also on the CASE object I have a field API name: Wealth_Planner_Email__c that is a EMAIL field and not related to anything.
On the EMPLOYEES object I have 3 fields
1. Name
2. Email__c
3. Title__c
I would like for the trigger to reach out to the EMPLOYEES object and grab the EMAIL address based on the name in the Wealth_PLanner_New_Field__c on the CASES object.
Does that make sense? I know I should understand this because I write in VBA, C# but trying to learn APEX is proving harder than I thought....
Thanks,
Brandon Nelson
Hi Brandon,
Please contact me on skype, we will fix the issue together.
Thanks,
Gaurav
Skype: gaurav62990
Thanks a lot...
Thanks
Gaurav