Salesforce: "No such column 'BOGUS' on entity"

Published by Henry Poyntz (Commander-in-Geek at Trausteknik) on 08 Mar 2018


To hopefully save someone the hours I just wasted. If you see this error message when doing an Create, Update, Upsert or Delete using the Force.com PHP Toolkit:
Fatal error: Uncaught SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: No such column 'BOGUS' on entity 'Thing__c'.
It's because you've double wrapped the record array:
$createArray = array();
$createArray[0]->Foo__c = 'bar';
$createResult = $sfdcConnection->create(array($createArray), 'Thing__c');
The issue here of course being that the array called "$createArray" is being wrapped in another array... Avoid doing that...
Give Us A Call Speak to our Team