zoho crm为什么xx是deal的关联对象但是调用函数时报错说不是关联对象
zoho.crm.getRelatedRecords("xx","Deals",acc_id);
你遇到的问题通常出现在 Zoho CRM 的 模块关联设置与 Deluge API调用格式不一致时。
🔍 错误分析:
你调用的是:
pricingoffices = zoho.crm.getRelatedRecords("Quotation","Deals",acc_id);
返回报错类似:
Invalid Module: Quotation is not a related list of Deals
即:“Quotation”不是“Deals”的关联模块。但你在 CRM 中看到 Quotation 是 Deal 的关联对象,这为什么还会报错?
✅ 核心原因(常见):
-
你使用的“Quotation”不是 API Name,而是模块的显示名称。
- Deluge 中
getRelatedRecords
的第一个参数必须是:子模块 在父模块中的 Related List API Name(不是子模块本身的模块名!)
- Deluge 中
✅ 正确写法需要两步确认:
步骤一:获取 Related List API 名称
- 打开 Zoho CRM → 设置(Setup)
- 进入 模块和字段(Modules and Fields)
- 选择
Deals
模块 - 点击右上角的「关联模块(Related Lists)」
- 找到
Quotation
那一行,点击右侧的「⋮」→「API 名称」 - 你会看到 Related List 的 API 名称,比如可能是:
Quotations
,Sales_Quotations
, 或Quote_Line_Items
⚠️ 注意:不是 “Quotation” 模块的模块 API 名,而是这个关联关系在 Deals
模块中的 related list 名。
步骤二:更新 Deluge 代码
假设你查到 Related List 的 API Name 是 "Sales_Quotations"
,则应该写成:
pricingoffices = zoho.crm.getRelatedRecords("Sales_Quotations", "Deals", acc_id);
❗️注意事项:
错误用法 | 原因 |
---|---|
"Quotation" | 不是 related list 的 API 名 |
模块名称写错大小写 | Deluge 区分大小写 |
acc_id 不是真实的 Deal 记录 ID | ID 必须是如 242456000000123456 这种格式 |
✅ 推荐调试方法:
可以通过调用:
info getRelatedLists("Deals");
这个函数可以列出 Deals
模块中所有 Related List 的 API 名和模块名,便于你确认使用的名称是否正确。
需要的话你可以告诉我:
Quotation
的模块 API 名- 它在
Deals
中显示在哪个位置 - 你希望获取哪些字段