• anthroprose
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi, i'm having a weird error when trying to set some fields to null. Here my code :
Code:
$paramsToNull =  new stdclass();

$paramsToNull->Id = '---blanked---';
$paramsToNull->fieldsToNull = array('Month_2_Volume__c');
$conn = GetSalesForceConnection();
try
{
$response = $conn->update(array($paramsToNull),'Lead');

}
catch(Exception $e)
{
 echo $conn->getLastRequest();
 
}

And I get this error : SoapFault exception: [soapenv:Client] Unexpected element {http://www.w3.org/2001/XMLSchema}string during simple type deserialization

GetLast Request give me this :
Code:
<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap-env:header><ns1:sessionheader><ns1:sessionid>462400D70000000IU3D!ARAAQBoC7VBwLSMFVqdnzTQ8RvqOmelRsG5AZhI1.XaHCgIpkgrEO.X9iCOTkAcfQqmEUq5LjG6Va.4E27IrIaAi90_TvLkQ</ns1:sessionid></ns1:sessionheader></soap-env:header><soap-env:body><ns1:update><ns1:sobjects xsi:type="ns1:Lead"><id>00Q7000000L0yvAEAR</id><fieldstonull><xsd:string>Month_2_Volume__c</xsd:string></fieldstonull></ns1:sobjects></ns1:update></soap-env:body></soap-env:envelope>

If I remove the fieldsToNull value and add some other fields value, the update work fine.

 I tried to reproduce using .Net instead of PHP and it work fine, using the same wsdl file.

Please help,
Elie