You need to sign in to do that
Don't have an account?
RRRize
How to display user's name using trigger
Hi. I have a trigger that sends an email. I have the email and merge fields in the trigger. One of the merge fields is Sales Rep. It is being pulled from a user lookup field. But the Sales Rep ID is displayed instead of the name. How can I display the actual user's name instead of the ID? Here is the line I am using in the trigger:
'<tr><td>Sales Representative</td><td>' + request.Sales_Representative__c + '</td></tr>'
Thanks for any help.
You'd need to retrieve the users information based on the lookup field value.
Something like:
Then you can write your code as:
etc
This is bit simple, just query Sales_Representative__r.Name where you are querying Sales_Representative__c and use it as a merge field.