You need to sign in to do that
Don't have an account?

setTargetObjectID on Opportunity to Send Email to Contact Roles
I need to send messages to Opportunity Contact Roles based on changes to aTriggered Value.
I have most of that working but it seems that setTargetObjectID is not available for the Opportunity Object....only Leads, Contacts or Users.
I could build a map of Contacts and Opportunity ID's and use the contact as the setTargetObjectID
and use the Opportunity as the setWhatId ..... but I am thinking the Email will only get logged in Activity against the Contact as the main object and not the Opportunity.
I suspect the only reason that the other objects can't use setTargetObjectID is that they do not have an "email" filed by default. Another frustrating Salesforce pothole. Has anyone had success getting them to enable it for their org?
Are there any other approaches out there?
Actually, just did a test and using whatID for the Opportunity did log correctly to the Opportunity. Next problem...no HTML Email Status related list on Opportunity....Oh Salesforce...why why why