获取Netsuite salesorder记录中shipmethod字段的文本
Netsuite 1.0 suitescript(在提交Userevent之后),salesRecObject.getFieldText(“shipmethod”)抛出“SSS\u NOT\u尚未受支持”异常,而salesRecObject.getFieldValue(“shipmethod”)给出“4”。我需要ShipVia字段的UI上显示的文本(ns内部Id:“shipmethod”)。您尝试过使用shiplabel字段吗?在我看来,您有两个选项:获取Netsuite salesorder记录中shipmethod字段的文本,netsuite,suitescript,Netsuite,Suitescript,Netsuite 1.0 suitescript(在提交Userevent之后),salesRecObject.getFieldText(“shipmethod”)抛出“SSS\u NOT\u尚未受支持”异常,而salesRecObject.getFieldValue(“shipmethod”)给出“4”。我需要ShipVia字段的UI上显示的文本(ns内部Id:“shipmethod”)。您尝试过使用shiplabel字段吗?在我看来,您有两个选项: 切换到SuiteScript 2.0。re
record.getText()
方法适用于2.0版中的shipmethod
字段var id = salesRecObject.getFieldValue("internalid");
var shipText = nlapiLookupField("salesorder", id, "shipmethod", true); //set the final argument to true to get text instead of value
或者,您可以通过shipitem记录而不是销售订单进行查找:
var shipMethodId = salesRecObj.getValue("shipmethod");
var shipMethodText = nlapiLookupField("shipitem", shipMethodId, "displayname");
function afterSubmit(type){
nlapiLogExecution('debug','type',type);
nlapiLogExecution('debug','ship',nlapiGetFieldText('shipmethod'));
}