Reply
Newbie
flxstr
Posts: 1
0

Upsert fails without any obvious error or reason

Hello!

 

I have an upsert that I'm attempting that fails without any obvious 'reason'.

 

Code is as follows:

 

foreach ($all_fields as $fieldset)
{
$sObject = new sObject();
$sObject->type = 'Product2'; // Salesforce Table or object that you will perform the upsert on
$sObject->fields = $fieldset;
array_push($sObjects, $sObject);
}
echo "<p>Beginning Upsert</p>";
$success = upsert_products($mySforceConnection, $sObjects);

}

 

function upsert_products($client, $sObjects)
{
try
{
echo "<pre>";
echo print_r($sObjects);
echo "</pre>";
$results = $client->upsert("Semiramis_GUID__c", $sObjects);
echo "this will never print";
}
catch (exception $e)
{
return false;
exit;
}
}

 

 

Array being sent is: 

 

Array
(
[0] => SObject Object
(
[type] => Product2
[fields] => Array
(
[ProductCode] => 02-1000B
[Semiramis_GUID__c] => asdf2
[Name] => Camo
[Description] => discontinued, Last time buy - October 1st, 2010
[Semiramis_ItemNo__c] => 01-01-05-01
)

)

[1] => SObject Object
(
[type] => Product2
[fields] => Array
(
[ProductCode] => 02-1005A
[Semiramis_GUID__c] => asdf3
[Name] => My product Name
[Description] => CMOS Was Here
[Semiramis_ItemNo__c] => 01-01-06-01
)

)

 

 

Can anyone identify any obvious errors, and why I don't see any updates to a product?