You need to sign in to do that
Don't have an account?
devNut!
setWhatId is inconsistent between api and salesforce UI
"Send an Email" through the salesforce UI allows you to specify a "Related To" record which can be of type custom object OR standard object.
However the WhatId property through the API only allows standard objects. Is this expected?
-------------- from the apex language reference -------------------------
Optional. If you specify a contact for the targetObjectId field, you can specify a whatId as well. This helps to further ensure that merge fields in the template contain the correct data. The value must be one of the following types:
However the WhatId property through the API only allows standard objects. Is this expected?
-------------- from the apex language reference -------------------------
Optional. If you specify a contact for the targetObjectId field, you can specify a whatId as well. This helps to further ensure that merge fields in the template contain the correct data. The value must be one of the following types:
- Account
- Asset
- Campaign
- Case
- Contract
- Opportunity
- Order
- Product
- Solution
- Custom
I'm trying to find similar information. I have a contact as my target but I want to include information from a lead in the template.
Initially I assumed the WhatId would act as the related to option in the UI, so I could do this, but the documentation says otherwise....
So is this a good thread question being otherwise ignored? Or am Ilooking at the problem from the wrong angle?
I solved my particular problem by writing a custom email parser. The code is "OK" - problems in a good parser are inherrant by (1) no access to the XSLT salesforce sues fro parsing email XML, and (2) lack of any "real" support for RegEx (yes, it exists but it's currently not great).
I use some code earlier to extratc the temaplate XML from salesfroce that the user edits and creates then I send it thorugh a custom parser to merge in each object. Ex. I can send in a Contact, a Lead and the Organisation information.
This gives me plenty of flexibility away from the rules enforced by salesforce limiting the use of template field mergers.
This is the merge method
Which is called (this code is loosly copied and pasted) from:
I don't know if this changed in the last 2 years or so, but the API documentation is clearly inaccurate on this point.