Netsuite 在字段更改时隐藏其他字段-套件脚本2.0

Netsuite 在字段更改时隐藏其他字段-套件脚本2.0,netsuite,suitescript,Netsuite,Suitescript,我想隐藏ID“custrecord\u hrx\u vendor\u status\u list” 在选择框(选项)中选择项目后 这是我的密码。 /** *@NApiVersion 2.x *@NScriptType ClientScript */ 定义(['N/ui/serverWidget','N/error'] function (error) { function fieldChanged(context) { var currentRecord = conte

我想隐藏ID“custrecord\u hrx\u vendor\u status\u list” 在选择框(选项)中选择项目后

这是我的密码。 /** *@NApiVersion 2.x *@NScriptType ClientScript */

定义(['N/ui/serverWidget','N/error']

function (error) {

    function fieldChanged(context) {
        var currentRecord = context.currentRecord;
        var fieldId = context.fieldId;
        if( fieldId === 'custrecord_hrx_negotiation_type' ){
            var selectedType = currentRecord.getText(fieldId);
            console.log(currentRecord.getField('custrecord_hrx_vendor_status_list'));

            currentRecord.updateDisplayType({
                id: 'custrecord_hrx_vendor_status_list',
                displayType: serverWidget.FieldDisplayType.HIDDEN
            });
        }
    }

    return {
        fieldChanged: fieldChanged
    }


}
))

----这里是错误


正如错误消息所说,您正试图加载一个不可用的模块。您正在编写客户端脚本,并尝试加载仅用于服务器端脚本的模块

此外,
N/currentRecord#currentRecord
没有
updateDisplayType()
方法

在SS2.0客户端脚本中隐藏字段的方法是:

currentRecord.getField({
  fieldId: 'custrecord_hrx_vendor_status_list'
}).isDisplay = false;

正如错误消息所说,您正试图加载一个不可用的模块。您正在编写客户端脚本,并尝试加载仅用于服务器端脚本的模块

此外,
N/currentRecord#currentRecord
没有
updateDisplayType()
方法

在SS2.0客户端脚本中隐藏字段的方法是:

currentRecord.getField({
  fieldId: 'custrecord_hrx_vendor_status_list'
}).isDisplay = false;

一切正常。谢谢你,先生!一切正常。谢谢你,先生!