You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sendEmail doesn't support multiple toAddresses #14
In pyforce.py _doPrep, there exists a joining of list items, which results in multiple items concatenated in a single element instead of multiple elements.
If this was a no-op or as follows, the generated SOAP XML request would have multiple <p:toAddresses /> elements.
else:
field_dict[k] = v
However, I do not know whether that would break anything else. Presumably this implementation is as-is for a reason. Maybe _prepareSObjects should be special-cased for sendEmail.
Yes, at least in some cases the sfdc api correctly parses ; delimited strings into arrays of strings. I haven't tested it with emails, and I assume you are bringing this forward because you have tested it?
I can't find the documentation about string array parsing, but I find it odd that it would be inconsistent. Can you try and find the related doucmentation?
Yes, I have tested it with with a list like ToAddresses = ["[email protected]", "[email protected]"], and with that one-line hack above. A modification to the post function to dump xml payload makes the mismatch apparent.
Multi-select picklist fields contain a list of one or more items from which a user can choose multiple items. One of the items can be configured as the default item. Selections are maintained as a string containing a series of attributes delimited by semicolons. For example, a query might return the values of a multivalue picklist as “first value; second value; third value”. For information on querying multi-select picklists, see Querying Multi-Select Picklists in the Salesforce SOQL and SOSL Reference Guide.
I deferred the decision for how that special handling should be done and just documented the problem. If you feel strongly about a particular solution please propose it.
Activity
ellieayla commentedon Nov 22, 2014
If this was a no-op or as follows, the generated SOAP XML request would have multiple
<p:toAddresses />elements.However, I do not know whether that would break anything else. Presumably this implementation is as-is for a reason. Maybe
_prepareSObjectsshould be special-cased forsendEmail.idbentley commentedon Nov 24, 2014
Yes, at least in some cases the sfdc api correctly parses ; delimited strings into arrays of strings. I haven't tested it with emails, and I assume you are bringing this forward because you have tested it?
I can't find the documentation about string array parsing, but I find it odd that it would be inconsistent. Can you try and find the related doucmentation?
ellieayla commentedon Nov 25, 2014
Yes, I have tested it with with a list like
ToAddresses = ["[email protected]", "[email protected]"], and with that one-line hack above. A modification to thepostfunction to dump xml payload makes the mismatch apparent.ellieayla commentedon Nov 25, 2014
It seems like this semicolon behavior is specific to multi-value picklist fields. http://www.salesforce.com/developer/docs/api/Content/field_types.htm#i1435691 says
See also;
ellieayla commentedon Nov 25, 2014
This behavior mirrors
multiMarshallerin marshal.py. Looks like it's been around for a while.ellieayla commentedon Dec 3, 2014
Note that this only affects pyforce.Client. xmlclient.Client doesn't do any marshaling of outbound lists so the list of addresses goes through intact.
idbentley commentedon Feb 5, 2015
This is a little bit annoying, and requires handling ; as a special case.
ellieayla commentedon Feb 7, 2015
I deferred the decision for how that special handling should be done and just documented the problem. If you feel strongly about a particular solution please propose it.