0

我想做的是使用 python 将 Salesforce 页面布局检索为 XML 文件,我尝试过使用 SFDCLIB、Salesforce_API、simple_Salesforce 但仍然无法找到一种方法来做到这一点,有没有人尝试过这样做?或者任何人对如何实现这一点有任何线索,请指导我完成整个过程。我只需要成功提交检索请求,请帮助。

4

1 回答 1

0

这应该可以通过 simple_salesforce 实现,下面的示例假设我们正在使用联系人

from simple_salesforce import Salesforce
sf = Salesforce(username='username@username.com', password='XpasswordX', security_token='XtokenX', sandbox=False)

#this is a specific contact record type id as layouts depend on the record type
record_type_id = '01258023423c9gYBAQ'

layout = sf.Contact.describe_layout(record_type_id)

这将为您提供数据的 json 版本而不是 xml,但结构与此处显示的相同:https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_layouts。 htm

例子layout['buttonLayoutSection']

于 2020-05-09T13:27:20.993 回答