使用工具 API 更新 Sales Force 上的“customField”的“valueSet”

问题描述

我正在尝试使用 tooling API 更新 Salesforce 上自定义字段的选项列表。

这是我的有效载荷:

        payload = {
            "Metadata": {
                "valueSet": {
                    "valueSetDeFinition": {
                        "value": [{'color': None,'default': False,'description': None,'isActive': None,'label': 'Agilysis'}],"sorted": True,},"restricted": False,}
            },}

我正在使用 python 库 simple-salesforce

发出请求
response = sf.toolingexecute(self.SALES_FORCE_OBJECT_NAME + self.id,method='PATCH',data=payload)

这会导致以下错误消息:

simple_salesforce.exceptions.SalesforceMalformedRequest: Malformed request https://canarytechnologies.my.salesforce.com/services/data/v52.0/tooling/sobjects/CustomField/00N5w00000ObMPzEAN. Response content: [{'message': 'At least one value is required to create this picklist.','errorCode': 'FIELD_INTEGRITY_EXCEPTION','fields': []}]

我无法找到我的有效负载的问题。我使用的是 API 版本 52.0。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)