netsuite自动填充一个字段

时间:2016-03-14 15:17:15

标签: netsuite suitescript

以下是使用自定义实体字段自动填充销售订单中字段的代码。

function exampleFieldChangedFunction(type, name, linenum){
  if(name == 'entity'){ //this line will make sure that the field being changed is the 'customer' field
    var customerValue = nlapiGetFieldValue('entity');   //the value of the customer field

    var customerclassValue = nlapiLookupField('entity', customerValue, 'custentitykn_division_regions');    //Class value on the customer record

    var customerClass = nlapiLookupField('custentitykn_division_regions', customerclassValue, 'class');

    nlapiSetFieldValue('class', customerClass); //auto-populate Division/Region with the new customer's class value
  }
}

0 个答案:

没有答案