我正在尝试调用Netsuite SuiteScript 2.0N/record
模块的加载函数,但是不确定如何传递参数。基本上,我希望N/record
UI中具有与当前记录相同的ID(主键),可以用来遍历子列表项。
我不确定如何使用记录浏览器来查找正确的类型和ID。记录浏览器没有类型,所以我猜了名字。还有多个字段可能是主键ID。是tranid
还是externalid
其他领域?我对库存调整表特别感兴趣。externalid
是undefined且tranid
将要生成。
是否可以通过这种方式获取N/Record
基础,currentRecord
还是也会遇到我遇到的相同问题currentRecord
(我不能selectLine
用来逐步浏览子列表项,子列表项尚未保存,最后一个部分完成)?
/**
* @NApiVersion 2.0
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/search', 'N/record'], function (s, r) {
function fieldChanged(context) {
var currentRecord = context.currentRecord;
var sublistName = context.sublistId;
var sublistFieldName = context.fieldId;
var currentLine = context.line;
var recordId = currentRecord.getValue({fieldId: "externalid"});
var record = r.load({
type: r.Type.INVENTORY_ADJUSTMENT,
id: recordId,
isDynamic: true
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句