You need to sign in to do that
Don't have an account?
SrBlanco
PHP: Error when trying to update object: "Fatal error: Class 'SObject' not found in..."
Hi All,
I am quite sure I am doing something stupid but i cant seem to get past this error. I am using the Enterprise SOAP client of the new 1.1 toolkit for PHP and am trying to update this object:
Array (
[Id] => 50020000000hl5kAAA
[Maint_Account__c] => 00120000002jpViAAI
[Maint_On_Open__c] => false
[Maint_Current__c] => false
)
With this code:
Fatal error: Class 'SObject' not found in [myscript].php on line 77
Line 77 is the "$sObject = new SObject();" line.
I have been pulling my hair out for half a day on this so if anyone can help I would really appreciate it.
I am quite sure I am doing something stupid but i cant seem to get past this error. I am using the Enterprise SOAP client of the new 1.1 toolkit for PHP and am trying to update this object:
Array (
[Id] => 50020000000hl5kAAA
[Maint_Account__c] => 00120000002jpViAAI
[Maint_On_Open__c] => false
[Maint_Current__c] => false
)
With this code:
$casefieldsToUpdate = array('Id'=>$case->Id, 'Maint_Account__c'=>$case->AccountId, 'Maint_On_Open__c'=>$caseassetcheck, 'Maint_Current__c'=>$caseassetcheck ); $sObject = new SObject(); $sObject->fields = $casefieldsToUpdate; $sObject->type = 'Case'; $caseupdate = $sfc_connection->update(array ($sObject));When I execute my script I get this error:
Fatal error: Class 'SObject' not found in [myscript].php on line 77
Line 77 is the "$sObject = new SObject();" line.
I have been pulling my hair out for half a day on this so if anyone can help I would really appreciate it.
Message Edited by Tran Man on 04-06-2007 12:08 PM
I am a bit of a noob when it comes to this stuff and I appreciate the help.
The link in your previous post doesnt seem to work for me. [edit] nevermind, I found it...
Thanks, Michael
Message Edited by SrBlanco on 04-06-2007 11:31 AM
I managed to get my updates working however for some reason custom fields will not update. All of the examples have you populating the sObject like so:
$sObject->customfield__c = 'field data';
That just wont work for me. When I add getLastRequest() I can see the standard fields in the output but my custom fields are no where to be seen. Any thoughts?
Thanks,
Michael