/*******************************************
*The Web Service example below performs an Add or
*Update request for a Customer record to set Country
*parameter other than US
*/
CustomerAddressbook address = new CustomerAddressbook(); address.defaultBilling = true;
address.defaultBillingSpecified = true;
address.label = "Billing Address";
address.addr1 = "4765 Sunset Blvd";
address.city = "Beverly Hills";
address.state = "ON";
address.zip = "L3R 3W5";
address.country = Country._canada;
address.countrySpecified = true; // need to set 'Country Specified' to true.
Check the SOAP request (Go to Setup > Integration > Web Services Usage Log). Notice that the country field has a value in the SOAP request:
<q1:addressbookList>
<q1:addressbook>
<q1:defaultBilling>true</q1:defaultBilling>
<q1:label>Billing Address</q1:label>
<q1:addr1>4765 Sunset Blvd</q1:addr1>
<q1:city>Beverly Hills</q1:city>
<q1:zip>L3R 3W5</q1:zip>
<q1:country>_canada</q1:country>
<q1:state>ON</q1:state>
</q1:addressbook>
</q1:addressbookList>
No comments:
Post a Comment