Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- Re: PHP Partner SOAP API Error : [sf:INVALID_FIELD...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
PHP Partner SOAP API Error : [sf:INVALI D_FIELD] INVALID_FI ELD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-12-2012 04:37 PM
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);
Re: PHP Partner SOAP API Error : [sf:INVALI D_FIELD] INVALID_FI ELD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-23-2012 12:15 AM
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

