首页 > 解决方案 > Zoho Books 自定义功能,用于更新字段并输入值

问题描述

我是开发和尝试创建自定义功能的新手,在估算模块中我有一个自定义字段(下拉),其中包含 3 个选项 0、50、100。我需要将自动保留发票复选框更新为 true 并填写百分比金额与自定义字段中的金额 (0,50,100)

标签: zohodeluge

解决方案


1)使用以下代码创建一个函数

自定义字段的名称:cf_retainer_percentage(在我的情况下。执行 getrecordsbyId 来识别您的自定义字段的名称) https://www.zoho.com/in/books/kb/estimates/est-customfield.html

自动保留语音复选框的 field_link_name:retainer_percentage

// Fetch the estimate ID
estimateID = estimate.get("estimate_id");
// Fetch tge organization ID
organizationID = organization.get("organization_id");
// Fetch the percentage from the custom drop down
percent = zoho.books.getRecordsByID("Estimates",organizationID,estimateID).get("estimate").get("custom_field_hash").get("cf_retainer_percentage");
// Set the retainer checkbox to true and set the percentage from the custom field
zoho.books.updateRecord("Estimates",organizationID,estimateID,{"accept_retainer":"true","retainer_percentage":percent});

2) 创建一个工作流规则来触发和映射上面创建的自定义函数。


推荐阅读