function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
zbeckmanzbeckman 

Can't update SFDC_Enrollment__c object, no error?

I'm trying to update an SFDC_Enrollment__c custom object. There are no errors showing up in the logs and it seems like it should have worked, but the database isn't updating. The code:

syslog(LOG_ERR, "Updating record for " . $enrollmentId . ".");
$enrollmentQueryResults = sforceQuery($connection, 1, "SELECT Id, Payment_Status__c, Payment_Amount__c from SFDC_Enrollment__c where Name = '" . $enrollmentId . "'");
if ($enrollmentQueryResults->records[0]) {
$enrollment = new SObject($enrollmentQueryResults->records[0]);
$enrollment->fields->Payment_Status__c = "Paid";
$result = $connection->update(array($enrollment));
syslog(LOG_ERR, "Order " . $enrollmentId . " received and status updated: " . $result . ".");
}

Generates this log message:

Jun 9 10:09:14 server /usr/sbin/httpd: Enrollment update for 200606-0062 received.
Jun 9 10:09:14 server /usr/sbin/httpd: Updating record for 200606-0062.
Jun 9 10:09:14 server /usr/sbin/httpd: Order 200606-0062 received and status updated: Object id #11.

No PHP errors, etc, but the database is unchanged. Any ideas?
SuperfellSuperfell
$result will contain an error with the status code & error message info.