获取Netsuite销售订单记录中的shipmethod字段的文本

时间:2018-05-01 10:03:28

标签: netsuite suitescript

Netsuite 1.0 suitescript(AfterSubmit Userevent),salesRecObject.getFieldText(“shipmethod”)抛出“SSS_NOT_YET_Supported”异常,而salesRecObject.getFieldValue(“shipmethod”)给我“4”。我需要在ShipVia字段的UI上显示的文本(ns内部标识:“shipmethod”)。

3 个答案:

答案 0 :(得分:0)

您是否尝试过使用过shiplabel字段?

答案 1 :(得分:0)

在我看来,你有两个选择:

  1. 切换到SuiteScript 2.0。 record.getText()方法适用于2.0版中的shipmethod字段。
  2. 如果出于兼容性原因或其他原因无法做到这一点,您可以执行以下操作:

    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");
    

答案 2 :(得分:0)

function afterSubmit(type){
  nlapiLogExecution('debug','type',type);
  nlapiLogExecution('debug','ship',nlapiGetFieldText('shipmethod'));
}