How to empty Company/Person fields with WebService ?

Hello,

I followed this thread in order to empty fields with WebService: community.sagecrm.com/.../how-do-you-set-a-null-value-via-soap-web-services.aspx

It works well for the Website field as depicted in example, however, there is many other fields that will not empty with this very same method.

Here are the calls I make and the results I get.

  • First I create a Company

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="">schemas.xmlsoap.org/.../">
<soap:Header>
<SessionHeader xmlns="
">http://tempuri.org/type">
<sessionId>74619221529320</sessionId>
</SessionHeader>
</soap:Header>
<soap:Body>
<add xmlns="">http://tempuri.org/type">
<entityname>company</entityname>
<records xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xsi:type="company">
<email>
<entityname>email</entityname>
</email>
<phone>
<entityname>phone</entityname>
</phone>
<balance>4.0</balance>
<employees>1-2</employees>
<indcode>Industry Code</indcode>
<mailrestriction>No</mailrestriction>
<name>Integration Test Company</name>
<payterms>custom payterm</payterms>
<revenue>$1M - $5M</revenue>
<secterr>Worldwide</secterr>
<sector>Agriculture</sector>
<source>Web</source>
<status>Inactive</status>
<type>Customer</type>
<website>www.podbox.com</website>
</records>
</add>
</soap:Body>
</soap:Envelope>

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../" SOAP-ENV:encodingStyle="">schemas.xmlsoap.org/.../" xmlns:xsi="">www.w3.org/.../XMLSchema-instance">
<SOAP-ENV:Body>
<addresponse xmlns="">http://tempuri.org/type">
<result>
<records xmlns:typens="">http://tempuri.org/type" xsi:type="typens:crmid">
<crmid>99</crmid>
</records>
</result>
</addresponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

  • Then, I update the company to empty its values

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="">schemas.xmlsoap.org/.../">
<soap:Header>
<SessionHeader xmlns="
">http://tempuri.org/type">
<sessionId>74619221529320</sessionId>
</SessionHeader>
</soap:Header>
<soap:Body>
<update xmlns="">http://tempuri.org/type">
<entityname>company</entityname>
<records xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xsi:type="company">
<email>
<entityname>email</entityname>
</email>
<phone>
<entityname>phone</entityname>
</phone>
<companyid>99</companyid>
<employees/>
<indcode/>
<mailrestriction/>
<name>AlmostEmptyCompany</name>
<payterms/>
<revenue/>
<secterr/>
<sector/>
<source/>
<status/>
<type/>
<website/>
</records>
</update>
</soap:Body>
</soap:Envelope>

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../" SOAP-ENV:encodingStyle="">schemas.xmlsoap.org/.../" xmlns:xsi="">www.w3.org/.../XMLSchema-instance">
<SOAP-ENV:Body>
<updateresponse xmlns="">http://tempuri.org/type">
<result>
<numberupdated>1</numberupdated>
<updatesuccess>true</updatesuccess>
</result>
</updateresponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

  • Finally I check with a query

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="">schemas.xmlsoap.org/.../">
<soap:Header>
<SessionHeader xmlns="
">http://tempuri.org/type">
<sessionId>74619221529320</sessionId>
</SessionHeader>
</soap:Header>
<soap:Body>
<query xmlns="">http://tempuri.org/type">
<queryString/>
<entityname>company</entityname>
</query>
</soap:Body>
</soap:Envelope>

Response:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../" SOAP-ENV:encodingStyle="">schemas.xmlsoap.org/.../" xmlns:xsi="">www.w3.org/.../XMLSchema-instance">
<SOAP-ENV:Body>
<queryresponse xmlns="">http://tempuri.org/type">
<result>

...

<records xmlns:typens="">http://tempuri.org/type" xsi:type="typens:company">
<typens:companyid>99</typens:companyid>
<typens:primaryaddressid>162</typens:primaryaddressid>
<typens:name>AlmostEmptyCompany</typens:name>
<typens:type>Customer</typens:type>
<typens:status>Inactive</typens:status>
<typens:source>Web</typens:source>
<typens:revenue>$1M - $5M</typens:revenue>
<typens:employees>1-2</typens:employees>
<typens:sector>Agriculture</typens:sector>
<typens:indcode>Industry Code</typens:indcode>
<typens:mailrestriction>No</typens:mailrestriction>
<typens:createdby>1</typens:createdby>
<typens:createddate>2014-09-15T09:50:51</typens:createddate>
<typens:updatedby>1</typens:updatedby>
<typens:updateddate>2014-09-15T09:50:55</typens:updateddate>
<typens:timestamp>2014-09-15T09:50:55</typens:timestamp>
<typens:secterr>Worldwide</typens:secterr>
<typens:balance>4</typens:balance>

...

I set up SageCRM to consider selection fields as String. Is there a way to empty values in SageCRM?