Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- Upsert fails without any obvious error or reason
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Upsert fails without any obvious error or reason
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-28-2012 01:13 PM
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?

