How to get related account's account owner's email from the Service Request object?
We are trying to write a workflow on the Service Request object to alert the account owner when a Service Request has been created. In order to do this, we must create a custom text field named AccountOwnerEmail_c that holds the account owner's email address. The AccountOwnerEmail_c field will be used in the object workflow.
Then, we have to create a trigger to populate the AccountOwnerEmail_c field with the related account owner's email. This is where we are having issues. The script below is what we currently have but it's failing on line 4.
The script needs to lookup the SR's related account, get the owner's email, and populate it in the AccountOwnerEmail_c field.