使用python检索Salesforce页面布局

2024-06-01 14:12:06 发布

您现在位置:Python中文网/ 问答频道 /正文

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


Tags: 文件方法api过程页面xml布局simple
1条回答
网友
1楼 · 发布于 2024-06-01 14:12:06

这应该可以通过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']

相关问题 更多 >