Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python,Beatbox-返回所有可用字段_Python_Python 2.7_Salesforce_Beatbox - Fatal编程技术网

Python,Beatbox-返回所有可用字段

Python,Beatbox-返回所有可用字段,python,python-2.7,salesforce,beatbox,Python,Python 2.7,Salesforce,Beatbox,我正在尝试对Salesforce运行一个查询,该查询使用beatbox返回所有字段的名称和API名称以及关联对象 以前有人这样做过吗?可能吗 谢谢Beatbox附带的demo.py中有一个例子 desc = svc.describeSObjects("Account") for f in desc[sf.fields:]: print "\t" + str(f[sf.name]) 将打印帐户上字段的所有API名称,如果您也需要标签,则为str(f[sf.labe

我正在尝试对Salesforce运行一个查询,该查询使用beatbox返回所有字段的名称和API名称以及关联对象

以前有人这样做过吗?可能吗


谢谢

Beatbox附带的demo.py中有一个例子

    desc = svc.describeSObjects("Account")
    for f in desc[sf.fields:]:
        print "\t" + str(f[sf.name])

将打印帐户上字段的所有API名称,如果您也需要标签,则为str(f[sf.label])

接受的答案会导致此错误:“TypeError:切片索引必须是整数或无,或具有索引方法”

这项工作:

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]

对我来说,这就像一种魅力:)

我遇到了同样的错误:Get“TypeError:切片索引必须是整数或无,或者具有索引方法”

我轻松获得了所有可用字段、标签和数据类型,如下所示: `


`

仅当您使用添加了pythonclient的beatbox叉子时,sf的类型是什么?它的beatbox。\u tPartnerNS。看见
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()]