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
AdamSBealAdamSBeal 

Inject Email Alert Address

I have a visual force page that creates a custom object called devicerequest which has a lookup field for a custom object named "Server". Server is a lookup on Accounts. I want to send an email to the Account Owner when someone creates a devicerequest. I have an email alert workflow setup but not sure how to get the account owners email into it or if that is even possible. Just looking for feedback as to how others would do it. 

 

Thanks!

VKrishVKrish

It is possible with Apex. So why dont you try creating custom component to do this part?

I think we can travel upto 5 objects with their id (look up field value) using '__r' in soql. I have done 3 levels many times.

Once you get the value of Account Owner Email Id, you can send mail using Mailing.SingleEmailMessage Object.