Ahhh! ... "describeObject" clears it up. Thanks!!
The reason that you see Calls__c in your enterprise wsdl file is because it is generated from your org, for your org.
The partner client has the ability to be able to use describeObject and describeGlobal that can get all custom tables / objects and fields on every object/table.
~Mike
Ahhh! ... "describeObject" clears it up. Thanks!!
cool glad that sets you straight. try the script and let me know if you can get it to work!!
Hey Mike,
Here's an update.
1. I got your code example to work. First time. Thanks a bunch!
2. I sent Dave Carroll at Salesforce a quick note, and he confirmed the error in "upsert" in the Enterprise Client, so hopefully that will get fixed for everyone in the next update.
3. The sObject class is defined within SforcePartnerClient.php instead of being in a file of its own. People wishing to use the Enterprise Client therefore need to include the Partner Client, just to get the definition of sObject. That seems counter-intuitive. It is also difficult to *find* the definition of sObject using grep, since it uses a capital "S" as in "class SObject".
4. Back to the example code for "upsert". There is an issue with the result that gets returned. It *always* reports that the objects are successfully *created*, even when they are really being *updated*. Yes, the first time, it should be "created", but all subsequent "upserts" to the same objects should be "updated". I checked inside Salesforce and I am not mistakenly "creating" many copies of the same data. It is correctly identifying the objects using the unique external__id. On the Salesforce side of the transcation, it really is doing an "update".
Can anyone confirm: Is this a *bug* in the Salesforce PHP Toolkit? Does it fail to distinguish between "create" and "update" ??
thanks,
David Jones
Is this happening with the enterprise client? because I use the upsert all the time and I never see duplicates using the partner client
Read this post again > PHP -> Salesforce "upsert", can't get tutorial example working
tell me if you can see the difference between created and updated using upsert
~Mike
To clarify, ... I am *not* seeing duplicates.
I am using the Partner Client, and when I do an "upsert" for existing records, the update happens, but the result is *falsely* reported as being "created", when it should be "updated".
If you run your demo code, the very first time (when the records are *new*) the result should be "created".
If you run the demo code *again*, with the same records, the result should be "updated". ... but it is not. It is still "created". Even though the records were actually "updated" on Saleforce. (I checked.)
-- DavidCode:Array ( [0] => stdClass Object ( [created] => [id] => a07300000053KvqAAE [success] => 1 ) [1] => stdClass Object ( [created] => [id] => a07300000053KvrAAE [success] => 1 ) )
... or maybe I am just misunderstanding the API return value.
Maybe "[created] => 1" means "created" and "[created] => NULL" means "updated".
-- David
Bookmarks