I'm trying to run a query into Salesforce that returns the names and API names of all the fields with an associated object using beatbox.
Has anyone done this before? Is it possible?
Thanks
I'm trying to run a query into Salesforce that returns the names and API names of all the fields with an associated object using beatbox.
Has anyone done this before? Is it possible?
Thanks
The accepted answer results in this error: "TypeError: slice indices must be integers or None or have an index method"
This works:
import beatbox
api = beatbox.PythonClient()
api.login(sf_username, sf_pw+sf_token)
obj_desc = api.describeSObjects("Order")[0]
names = [name for name in obj_desc.fields]
For me this works like a charm :)
I Faced the same error : got "TypeError: slice indices must be integers or None or have an index method"
I got all available fields, labels, data-type easily as : `
import beatbox
api = beatbox.PythonClient()
api.login(sf_username, sf_pw+sf_token)
fields = api.describeSObjects("Account")[0].fields
all_table_list = [ {'name':key[1].name,'label':key[1].label,'type':key[1].type} for key in fields.iteritems()]
`
There's an example of that in demo.py that comes with Beatbox,
will print all the API names of the fields on Account, if you want the labels as well, that'd be str(f[sf.label])