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
hemanth reddy _SFDhemanth reddy _SFD 

setWhatId - Issues with multiple IDs

How can i specify Multiple SetWhatID's ?
my intention is to send an email template which is using muliple fields from multiple Sobjects using Apex class.So inorder to do so, I have to use :setwhatId(Id of the sobject  whose fields are being using in template);
but as i said iam using multiple fileds from different Sobjects, So how to solve this issue ?
please help me out 
Donald BlayDonald Blay
A template cannot handle multiple objects as the 'What' object.  It can only refer to one object as the what and one object as the who.  

Depending on if the 2 what-objects you want to use are related, you may be able to creat formula fields on one of the objects that pulls the values from the other.  And then use that object as the WhatId.  

 
hemanth reddy _SFDhemanth reddy _SFD
Thank you Don Blay for clearing my doubt.