You need to sign in to do that
Don't have an account?
evgenyka
Ho to create a null date
Hello
How can i insert null date in custom object
i have tried: NULL ,' ', " ", 00:00:00
and always getting this error
Fatal error: Uncaught SoapFault exception: [soapenv:Client] 'NULL' is not a valid value for the type xsd:date in /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php:585
Stack trace:
#0 [internal function]: SoapClient->__call('upsert', Array)
#1 /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php(585): SoapClient->upsert(Object(stdClass))
#2 /oracle_general/SF/line_load.php(144): SforceBaseClient->upsert('LINE_ID__C', Array)
#3 {main}
thrown in /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php on line 585
How can i insert null date in custom object
i have tried: NULL ,' ', " ", 00:00:00
and always getting this error
Fatal error: Uncaught SoapFault exception: [soapenv:Client] 'NULL' is not a valid value for the type xsd:date in /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php:585
Stack trace:
#0 [internal function]: SoapClient->__call('upsert', Array)
#1 /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php(585): SoapClient->upsert(Object(stdClass))
#2 /oracle_general/SF/line_load.php(144): SforceBaseClient->upsert('LINE_ID__C', Array)
#3 {main}
thrown in /oracle_general/SF/sforce-php/soapclient/SforceBaseClient.php on line 585
$fields->fieldsToNull = array('myDateField');
Is this also working on create and not for update?
Code:
$createFields->fieldsToNull = array('whatever');
to
$createFields->fieldsToNull = array();
$createFields->fieldsToNull[] ='field1';
$createFields->fieldsToNull[] ='field2; and so on
or
$createFields->fieldsToNull = array();
array_push($createFields->fieldsToNull,'field1');
array_push($createFields->fieldsToNull,'field2'); and so on
Your current statement replaces the value of fieldsToNull on each statement.
I would also suggest using the correct case for your field names, according to your WSDL. They will not be all upper case and will end in '__c'.
fieldsToNull is not necessary (or valid) on create; just do not pass the values that are to be left null.