Zoho Books Custom函数可更新字段并输入值

时间:2019-05-23 13:56:33

标签: zoho deluge

我是开发和尝试创建自定义函数的新手,在估算模块中,我有一个具有3个选项0、50、100的自定义字段(下拉列表)。 我需要将“自动保留发票”复选框更新为true,然后使用自定义字段(0,50,100)中的金额填写百分比金额

1 个答案:

答案 0 :(得分:0)

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)创建工作流程规则以触发和映射上面创建的自定义功能。