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
Erik Muttersbach 6Erik Muttersbach 6 

Why can't I query all fields of Lead with the bulk API?

I am using the bulk API to fetch leads from Salesforce. The SObject Lead has, among others, the default field Fax and MobilePhone. However, the following query fails:
SELECT Name,Fax,MobilePhone FROM Lead
with the following error:
[Error: InvalidBatch : Failed to process query: INVALID_FIELD:  SELECT Name,Fax FROM Lead             ^ ERROR at Row:1:Column:13 No such column 'Fax' on entity 'Lead'. 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.]
Why can't i query these fields although they appear as standard fields under Customize -> Leads -> Fields?

 
john yungkjohn yungk
The query itself looks fine and worked when I ran it from Bulk API against my development environment. It must be another problem, perhaps the user credentials used by Bulk API don't have permission to this fields?

Good luck,
John
Erik Muttersbach 6Erik Muttersbach 6
Hi John,

thanks for the answer! Actually Field Level Security is my problem. My user's role is System Administrator. Which other role would you advise for unlimited API acess?

Erik
john yungkjohn yungk
we typically create a profile specifically for data integration and give it the proper security level (field level security permissions, etc.) that are required for each on the integrations.

Good luck,
John