如何在Netsuite中通过adhoc CS设置字段的值?

问题描述 投票:0回答:1

我在采购订单中通过UE脚本创建了一个按钮。当点击一个警报提示时,用户可以写下文字,当点击提示框中的 "确定 "时,该文字将被保存在一个自定义体字段中。submitFields 但它没有任何作用。谁能帮我解决这个问题?

用户事件代码。

        context.form.addButton({
            id: 'custpage_reject',
            label: 'Reject With Reason',
            functionName: 'rejectButton()'
        })
        context.form.clientScriptModulePath = 'SuiteScripts/mx_rejectionReason_cs.js';

客户端脚本功能

function rejectButton() {
    rejectReasonValue = window.prompt("Reason for Rejection ?");
    console.log('prompt:', rejectReasonValue)

    nsCurrentRecord.submitFields({
        type: recType,
        id: recId,
        values: {
          custbody_reasonof_rejection: rejectReasonValue,
        },
        options: {
          enableSourcing: true,
          ignoreMandatoryFields: true
        }
      });
}
suitescript suitescript2.0
1个回答
1
投票

尊敬的客户,您好

我想你的submitFields不会在当前加载的记录上工作。

试着在当前记录上设置字段值,像这样。

currentRecord.setValue('custbody_reasonof_rejection', rejectReasonValue);

希望这对你有用!

© www.soinside.com 2019 - 2024. All rights reserved.