令人困惑的SalesForce错误

0 php salesforce

我正在使用SalesForce PHP工具包并获得连接.但是,当我使用任何示例代码时 - 请参阅此处

INVALID_FIELD: No such column '' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Run Code Online (Sandbox Code Playgroud)

我可能只是在努力找到答案,因为谷歌不会让我搜索''

环境是带有PHP 5.3的CentOS 6.

小智 5

我刚刚在这里创建了一个帐户来回答这个问题.我整天花了很长时间才发现PHP Toolkit中的这个错误.问题是由"fieldsToNull"属性引起的.我读了一个约.这里的解决方案让我知道在哪里寻找解决方案.

所以一个正确的例子是:

 $fields = array('LastName' => 'Doe');
 $sObject = new SObject();
 $sObject->fields = $fields;
 $sObject->fieldsToNull = NULL;//this is the solution! :)      
 $sObject->type = 'Contact';
Run Code Online (Sandbox Code Playgroud)

然后,像往常一样继续使用PHP Toolkit的其余部分示例.它与我的合作伙伴WSDL + Developer SF帐户一起运行良好.

希望能帮助到你!