Skip to content
Advertisement

Error executing simple select query on salesforce

I’m trying to execute a query:

JavaScript

But I get this error:

Fatal error: Uncaught SoapFault exception: [soapenv:Client] Element {}item invalid at this location in /Library/WebServer/Documents/force/soapclient/SforceBaseClient.php:797 Stack trace: #0 /Library/WebServer/Documents/force/soapclient/SforceBaseClient.php(797): SoapClient->__call(‘query’, Array) #1 /Library/WebServer/Documents/force/soapclient/SforceBaseClient.php(797): SforceSoapClient->query(Array) #2 /Library/WebServer/Documents/force/dummy.php(18): SforceBaseClient->query(‘SELECT email__c…’) #3 {main} thrown in /Library/WebServer/Documents/force/soapclient/SforceBaseClient.php on line 797

I’m not sure what I’m doing wrong. I’m using the Workbench SOQL Salesforce, and the query works good. What is wrong?

Advertisement

Answer

It looks like your Sales Force query should work well – however I’m not familiar with the “QueryResult” function, perhaps try to dump that line and see if it works. That may be for only one result, basically we normally just iterate through the records like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement