Open ellieayla opened 9 years ago
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 = ["me@example.com", "you@example.com"]
, and with that one-line hack above. A modification to the post
function to dump xml payload makes the mismatch apparent.
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
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.
See also;
This behavior mirrors multiMarshaller
in marshal.py. Looks like it's been around for a while.
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.
This is a little bit annoying, and requires handling ; as a special case.
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.
http://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_sendemail.htm states that several fields, including toAddresses, accept arrays of values. in SOAP XML, this translates to multiple
<p:toAddresses />
elements.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.