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
MsKnightMsKnight 

setWhatIds - Issues with multiple IDs

Hello,

I'm sending an email based on a template that has merge fields from several different objects. I am using a template that has merge fields from both our Project (p) object and our Permit (permit) object. I am currently using "mail.setWhatId(p.Id);" which returns an email with the project merge fields filled and the permit merge fields blank. I am aware that there is a function setWhatIds, but I cannot figure out how to enter both the project Id (p.Id) and the permit Id (permit.Id). I have tried all of the following variations with no success:

mail.setWhatIds(p.Id, permit.Id);
mail.setWhatIds(p.Id permit.Id);
mail.setWhatIds(p.Id; permit.Id);

What is the proper way to enter mulitple IDs?


Thanks!