Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I've been researching this and trying many variations based off my understanding of how to update a record in an SObject, but I keep getting the following error:

SoapFault exception: [sf:INVALID_TYPE] INVALID_TYPE: Must send a concrete entity type. in /home/public_html/soapclient/SforceBaseClient.php:509

I am able to login successfully to the page, but when I execute the code below, I am getting the error listed above.

  $fieldsToUpdate = array (

        "Name"=>$_POST['Name']

    );

    $sObject = new SObject();

    $sObject->Id = $_POST['prospectID']; // this is the Id of the record

    $sObject->fields = $fieldsToUpdate;

    $sObject->type = 'Prospect__c'; // this is the API name of custom object

    try {

        $response = $mySforceConnection->update($sObject);

    } catch (Exception $e) {

        echo $e;

    }

I am using PHP Toolkit 13.0 from the Force.com developer docs, but not able to get to the bottom of this error. Also, I am using the Enterprise WSDL in sandbox mode, and have the proper wsdl xml assigned.

Thanks.

1 Answer

0 votes
by (32.1k points)
edited by

sObject is the base type for all other Salesforce objects that can be updated. When using the enterprise API (SOAP), you'll need to pass instances that derive from sObject. (Lead, Contact, and Account are examples)

Here is the documentation for the update() method as well.

Enroll in our Best Salesforce Course to get a professional certification!

Related questions

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

Browse Categories

...