You need to sign in to do that
Don't have an account?
venema
Upsert Problem
I'm having a problem with the upsert() function in the API.
I'm trying to update a single Contact record, and the result I get back from SalesForce is as follows:
stdClass Object
(
[created] =>
[id] => 00300000004NL8rAAG
[success] => 1
)
(
[created] =>
[id] => 00300000004NL8rAAG
[success] => 1
)
This indicates to me that the update was performed successfully. In fact, when I check in the web UI, the last modified time has been updated accordingly to show that something was done.
The problem is that nothing changes in the record. I'm supposed to be updating the address, phone number, and title of this person, and yet nothing changes that I can see.
Any ideas?
Certainly. It's a function in my class.SalesForceAPI.php:
Code:
The function takes two inputs:
1) $data is a two-dimensional array version of a CSV file. The first row contains headers, the second, third, fourth, etc. rows contain values.
2) $mapping is a one-dimensional array that maps SalesForce field names to the header names in the data file. The first operation in the function flips the keys/values so it's the header names mapping to the SalesForce field names.
Code:
After running the function on a data file with a single record, I get an array of stdclass objects that looks like this:
Code:
Sorry, the mapping for this example looks like this:
Code:
I used tcpmon to get the actual TCP request being sent to SalesForce. Looks like this:
Code:
It looks to me like the object being submitted is empty...