jeb*_*eee 1 netsuite suitescript
我想在选择框(选项)中选择项目后隐藏ID"custrecord_hrx_vendor_status_list".
这是我的代码./***@NApiVersion 2.x*@NScriptType ClientScript*/
define(['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
}
}
Run Code Online (Sandbox Code Playgroud)
);
----这就是错误
如错误消息所示,您正在尝试加载不可用的模块.您正在编写客户端脚本,并尝试加载仅用于服务器端脚本的模块.
另外,N/currentRecord#CurrentRecord没有updateDisplayType()方法.
在SS2.0客户端脚本中隐藏字段的方法是:
currentRecord.getField({
fieldId: 'custrecord_hrx_vendor_status_list'
}).isDisplay = false;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1818 次 |
| 最近记录: |