You need to sign in to do that
Don't have an account?
tvignon
Using API update()
Hi all -
I've been working today on a simple PHP page that will record a user's response in a form and update a corresponding field on their account. I'm getting a success message from my update() code when I print_r, but I'm not actually seeing any updated information in my accounts. The code I have is as follows:
The ID is a known field that will be a passed variable in the URL. When the page is accessed and the form is submitted, I get the following print message:
stdClass Object ( [id] => 0017000000NoRVFAA3 [success] => 1 ) Thank you for your response. Your information has been submitted.
However, like I said, if I check the fields in the sObject on the Account page, they have not been updated. I know it's got to be something simple I'm overlooking, but it's Monday of course. Any help will be greatly appreciated.
Thanks!!
Travis Vignon
I've been working today on a simple PHP page that will record a user's response in a form and update a corresponding field on their account. I'm getting a success message from my update() code when I print_r, but I'm not actually seeing any updated information in my accounts. The code I have is as follows:
Code:
$prop = addslashes($_GET['prop']); $rank = $_POST['NPS']; $nps = new sObject(); $nps->type = 'Account'; $nps->Id = $prop; $nps->fields = array('NPS_2__c' => '$rank', 'NPS_2_Date__c' => 'DATE'); print_r($mySforceConnection->update($nps)); echo "Thank you for your response. Your information has been submitted.";
The ID is a known field that will be a passed variable in the URL. When the page is accessed and the form is submitted, I get the following print message:
stdClass Object ( [id] => 0017000000NoRVFAA3 [success] => 1 ) Thank you for your response. Your information has been submitted.
However, like I said, if I check the fields in the sObject on the Account page, they have not been updated. I know it's got to be something simple I'm overlooking, but it's Monday of course. Any help will be greatly appreciated.
Thanks!!
Travis Vignon
Can anyone help us out, I have looked everywhere and I cannot find a solution to this problem.
I made the original post and never got a reply, so I just had to figure it out for myself. It was actually really simple for me. The only change I had to make was in the update line:
I had to wrap my $nps object in an array before it would update properly. If you read my original post, the update line looked like this: