You need to sign in to do that
Don't have an account?
webdbproject
How to use the fieldsToNull on PHP?
I am trying to do an update a field to empty string using fieldsToNull, but it never works.
The following is the code:
$fieldsToUpdate = array('Id'=>$ID,'Test__c'=>NULL);
$sObject = new SObject();
$sObject->fieldsToNull = $fieldsToUpdate;
$rs = $mySforceConnection->update(array($sObject));
Please help...
Thanks
Do you know when you will have the version? Since I am on a deadline to implement this.
Thanks
Pass in the column name you want to null out like so:
Code:
Let me know if that works.
Message Edited by Tran Man on 05-23-2006 02:52 PM
It doesn't work and I probably wrong:
The following is the code. I want to set Name_c custom field to empty string.
$sObject = new SObject();
$sObject->fields = $fieldsToUpdate;
$sObject->fieldsToNull = array("Name__c");
$sObject->type = 'Lead';
$acct = $mySforceConnection->update(array($sObject));
Thanks
Message Edited by webdbproject on 05-23-2006 04:26 PM
Can you print out $acct?
print_r($acct);
It shows
stdClass Object ( [errors] => [id] => 00Q3000000C4EtcEAF [success] => 1 )
Thanks
Echo your SOAP messages by doing the following.
echo $mySforceConnection->getLastRequest;
echo $mySforceConnection->getLastRequestHeaders;
echo $mySforceConnection->getLastResponse;
echo $mySforceConnection->getLastResponseHeaders
Hi Sorry for not checking my email
I got nothing after echo
$mySforceConnection->getLastRequest:
$mySforceConnection->getLastRequestHeaders:
$mySforceConnection->getLastResponse:
$mySforceConnection->getLastResponseHeaders:
Thanks and I will check your response daily
echo $mySforceConnection->getLastRequest;
Yes, I echo like this
echo $mySforceConnection->getLastRequest;
echo $mySforceConnection->getLastRequestHeaders;
echo $mySforceConnection->getLastResponse;
echo $mySforceConnection->getLastResponseHeaders;
and get nothing. Thanks...
try {
// your code
} catch (Exception $e) {
print_r($e);
}
Also, I didn't see in your second snippet of code where you specified an Id.
The object I call update() on:
The fields still hold their previous value (are not null)
Any update on this. It still does not seem to work ?
Thanks.
You're right, it's still not working. I have an outstanding support ticket on this. I spent the better part of a day studying the toolkit code, and it looks to me like they just didn't implement the fieldsToNull part of the API. :-) They have not exactly thrown themselves into fixing this either - no work on my request for many weeks, despite my frequent pestering. I'll try to remember to keep you posted if there's any progress, but I would also encourage you to post your own support request, since there may be some power in numbers.
Jesse
- Nick
Could you send the test version to me as well, I need to use fieldsToNull on PHP.
Thanks,
I can verify that Nick's modifications fixed the problem. Enjoy!
Jesse
I also need the version of the toolkit with support for fieldsToNull.
Thanks,
Mike