Netsuite 针对所有交易记录类型部署SuiteScript
是否有方法针对所有交易记录类型部署SuiteScript?(除了为每种事务类型创建单独的部署之外)如果nlapiGetRecord()是事务类型的一种,则可以部署到所有记录,然后放置if语句Netsuite 针对所有交易记录类型部署SuiteScript,netsuite,suitescript,Netsuite,Suitescript,是否有方法针对所有交易记录类型部署SuiteScript?(除了为每种事务类型创建单独的部署之外)如果nlapiGetRecord()是事务类型的一种,则可以部署到所有记录,然后放置if语句 var txnTypes = ['salesorder','invoice','purchaseordet']; if(txnTypes.indexOf(nlapiGetRecord()!=-1) { //code goes here; } 无论哪种方式都是50/50,哪种方式更容易。我认为部署最好,因为
var txnTypes = ['salesorder','invoice','purchaseordet'];
if(txnTypes.indexOf(nlapiGetRecord()!=-1) { //code goes here; }
无论哪种方式都是50/50,哪种方式更容易。我认为部署最好,因为它不会在另一条记录上运行。如果nlapiGetRecord()是事务类型之一,则可以部署到所有记录,然后放置if语句
var txnTypes = ['salesorder','invoice','purchaseordet'];
if(txnTypes.indexOf(nlapiGetRecord()!=-1) { //code goes here; }
无论哪种方式都是50/50,哪种方式更容易。我认为部署最好,因为它不会在其他记录上运行。部署到所有事务记录类型,然后在代码中应用如下条件:
var recordType = nlapiGetRecordType();
if(recordType != 'salesorder' && recordType != 'purchaseorder'){
return; //Exit
}
//Continue code here.
部署到所有事务记录类型,然后在代码中应用以下条件:
var recordType = nlapiGetRecordType();
if(recordType != 'salesorder' && recordType != 'purchaseorder'){
return; //Exit
}
//Continue code here.