You need to sign in to do that
Don't have an account?
banton
Date create question
I am having trouble creating a contact object that includes a Birthdate. Whenever I add the Brithdate field it does not insert the entry into SalesForce. I assume that it has something to do with the way that I am defining the current date. Below is the code:
$birthdate = date('m/d/Y');
....
'Birthdate' => $birthdate,
....
Any help would be appreciated.
$birthdate = date('m/d/Y');
....
'Birthdate' => $birthdate,
....
Any help would be appreciated.
$birthdate = gmdate("Y-m-d\TH:i:s\Z",$mydate);
$FIELDS=array(
'type' => 'Account',
'AnnualRevenue' => $a,
'Name' => utf8_encode("testAccount"));
$result=$client->create($FIELDS);
Where $a is a double.
'AnnualRevenue' => [$a,'xsd:double'],
'Name' => [utf8_encode("testAccount"),'xsd:string']
Maybe if the second part is not specified, it defaults to a string.
At least some versions of the library us this flag in the SOAP/Base module to decide whether to attempt to parse doubles, base64 and date values, or leave them as strings.
You'll need to make sure that your double has a decimal part - even if it's .0 - in order for this to work. i.e. $foo = 12.0
Thank you for this suggestion. All those who are experiencing formatting problems with dates (using PEAR), in my case inserting an ActivityDate for a in Activity History, the suggestion above worked. That is, setting the $SOAP_RAW_CONVERT = true;
What I did was add that line to the \SOAP\Base.php page, and then my line of code looked like the following:
$xddate = gmdate('Y-m-d\T13:00:00\Z');
Fields = array('type'=>task, 'WhoId=>$exist_id,'Subject'=>$finfo,'ActivityDate'=>$xddate);
error : INVALID_TYPE_ON_FIELD_IN_RECORD
--------------------------code-----------------------------
$event = new SObject ('Event', null , array('ActivityDate' => '21/03/2006',
'IsAllDayEvent' => true,
'IsRecurrence' => false,
'OwnerId' => $id,
'Type' => 'Call',
'WhoId' => $WhoId,
'ShowAs' => 'Busy' ) ) ;
$createEventRes = $sfdc->create($event);
---------------------------/code---------------------------
I tried : gmdate(), date() in a lot of different format.
Thanks :)