You need to sign in to do that
Don't have an account?
Steve Ferree
email from Apex trigger - need to add custom case field
Ok I am new to Apex, this should be easy but I am not finding a good resource manual. I have a Apex trigger to send an form email whenever a case changes owner.
What I'd like to do is include a link to the orginal case.
Here is what I think is the relevant lines as they exist
mail.setSubject('You are now the Owner of Case#:'+Trigger.new[i].CaseNumber);
mail.setPlainTextBody('Ownership of Case#:'+Trigger.new[i].CaseNumber+' has been set to you. Have a Nice Day.');
so I need to change this from plain text and include a field from the case containing the threadID so it'll link back to the case.
can that field be included?
What I'd like to do is include a link to the orginal case.
Here is what I think is the relevant lines as they exist
mail.setSubject('You are now the Owner of Case#:'+Trigger.new[i].CaseNumber);
mail.setPlainTextBody('Ownership of Case#:'+Trigger.new[i].CaseNumber+' has been set to you. Have a Nice Day.');
so I need to change this from plain text and include a field from the case containing the threadID so it'll link back to the case.
can that field be included?
You can write like this
Get the host in the trigger like for e.g for developer edition
mail.setPlainTextBody('https://ap1.salesforce.com/'+Trigger.new[i].Id);
All Answers
You can write like this
Get the host in the trigger like for e.g for developer edition
mail.setPlainTextBody('https://ap1.salesforce.com/'+Trigger.new[i].Id);