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
WarrenWarren 

PHP toolkit update call

Hi,
 
I am using 1.0.6 version of the PHP toolkit and trying to call update().
 
This is what I am trying to update:
 
SObject Object
(
    [Id] => a0O30000000I3BQEA0
    [type] => CreditSale__c
    [fields] => Array
        (
            [Id] => a0O30000000I3BQEA0
            [StatusCode__c] => Submitted
            [type__c] => invoice
        )
)
 
with this code:
 
$fieldsToUpdate = array('Id'=>$cc,'StatusCode__c'=>'Submitted','type__c'=>'invoice');
  $sObject = new SObject();
  $sObject->type = 'CreditSale__c';
  $sObject->Id = $cc;
  $sObject->fields = $fieldsToUpdate;
  print_r($sObject);
  $acct = $client->update($sObject);
 
but this call always fails with "[sf:INVALID_TYPE] INVALID_TYPE: Must send a concrete entity type."
 
Does anyone have a fix for this problem? I seem to be going round in circles.
 
Thanks in advance.
  
WarrenWarren
Forget this last post, I have managed to fix it.
alex_manhalex_manh
Hi Warren,

would you mind explaining how you fixed the issue?

Thanks.
WarrenWarren
Yes, the Id should be set by using the array member i.e:
 
$sObject->Id = $cc[0];
 
Warren