from simple_salesforce import Salesforce
import pandas as pd
# username = 'USER_NAME'
# password = 'PASSWORD'
# security_token = 'SECURITY_TOKEN'
uname = 'USER_NAME'
passwd = 'PASSWORD'
token = 'SECURITY_TOKEN'
sfdc_query = Salesforce(username = uname,password=passwd,security_token=token)
object_list = []
for x in sfdc_query.describe()["sobjects"]:
object_list.append(x["name"])
object_list = ['ag1__c'] # my custom database in sales force
obj = ", ".join(object_list)
soql = 'SELECT FIELDS(CUSTOM) FROM ag1__c LIMIT 200' # CUSTOM
sfdc_rec = sfdc_query.query_all(soql)
sfdc_df = pd.DataFrame(sfdc_rec['records'])
sfdc_df
Here i am trying to get all the records from my custom database in sales force which has 1044 rows and i want to extract all the records. i have tried lot of things but its not working please help me out with this, it will be great help to me. thanks
ERROR: -
SalesforceMalformedRequest: Malformed request https://pujatiles-dev-ed.develop.my.salesforce.com/services/data/v52.0/query/?q=SELECT+FIELDS%28CUSTOM%29+FROM+ag1__c. Response content: [{'message': 'The SOQL FIELDS function must have a LIMIT of at most 200', 'errorCode': 'MALFORMED_QUERY'}]