You need to sign in to do that
Don't have an account?
evgenyka
foreach ($data as $v){
$createField=array(
'Name'=>$v[1],
'Description'=>$v[2],
'Product_Type__c'=>$v[3],
'Family'=>$v[4],
'Inventory_Item_id__c'=>$v[5]
);
print_r ($createField);
$external_id = 'Inventory_Item_id__c';
$sObject1 = new SObject();
$sObject1->fields = $createFields;
$sObject1->type = 'Product2';
$upsertResponse = $mySforceConnection->upsert($external_id, array($sObject1));
print_r ( $upsertResponse);
Issue with Upsert
Hello when i am trying to upsert from php code
i am getting an error about missing argument ,
However the argument is exist
my code is
foreach ($data as $v){
$createField=array(
'Name'=>$v[1],
'Description'=>$v[2],
'Product_Type__c'=>$v[3],
'Family'=>$v[4],
'Inventory_Item_id__c'=>$v[5]
);
print_r ($createField);
$external_id = 'Inventory_Item_id__c';
$sObject1 = new SObject();
$sObject1->fields = $createFields;
$sObject1->type = 'Product2';
$upsertResponse = $mySforceConnection->upsert($external_id, array($sObject1));
print_r ( $upsertResponse);
The data is
Array
(
[Name] => MHGS18-XTC
[Description] => sdsd
[Product_Type__c] => HCA
[Family] => CHEETAH DDR
[Inventory_Item_id__c] => 31083
)
and the error i get
[message] => Inventory_Item_id__c not specified
[statusCode] => MISSING_ARGUMENT
Code:
Message Edited by evgenyka on 04-02-2007 11:34 AM
Hello,
where you define your array as '$createField=array(...........' you have missed the 's' off.
Try: $createFields=array(...........
and see if it works.
cheers