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
AU5T1NAU5T1N 

PHP Partner SOAP API Error : [sf:INVALID_FIELD] INVALID_FIELD

Environment : PHP SOAP API using Partner WSDL

 

[sf:INVALID_FIELD] INVALID_FIELD: No such column '' on entity 'Goal__c'.

Here's a snippet of the source, I'm almost 100% sure that the code provided by SalesForce is resetting the fields array to NULL. I've stepped through this about 100x and have proved that it generates semantically correct xml until it passes the document through the update method. Something then happens on the salesforce side and the error above is returned.

$fields['goal__c'] = '1';
$fields['EndDate__c'] = '2012-12-05';
$fields['Type__c'] = 'Monthly';
$fields['StartDate__c'] = '2012-09-01';

$sObject = new sObject();
$sObject->type = 'Goal__c';// Salesforce Table or object that you will perform the update on
$sObject->fields = $fields;
$sObject->Id = "a00E0000005HoXUIA0";

$sObjects[] = $sObject;

$upsertResult = $client->update($sObjects);

EmplEmpl

Try adding fields to your object as below (Instead of passing an array):

 

$sObject = new stdClass();
$sObject->fields->Case__c                  = '500R0000003dC5S';
$sObject->fields->box_file_id__c        =  'PHPTest';
$sObject->fields->box_file_name__c = 'TestPHP';
$sObject->fields->box_file_path__c   = 'XXXXXXXXXXXXXXX';
$sObject->type                                        = 'case_attachment__c';   //Your custom object

 

$result = $this->mySforceConnection->create(array($sObject));

 

 

Same should go for upsert also I guess.

 

 

Thanks,

Vishal