在某些情况下,我正在尝试将采购订单上的税码从默认代码更改为其他代码。我已经将脚本放在后采购,它会按预期更改税码。但是当PO被保存时,它会再次返回默认税码!
Post Sourcing中的代码如下。这方面的任何帮助都是非常感谢的!
// Set Tax Code
function setTaxCode(scriptContext){
var currentRecord = scriptContext.currentRecord;
var RecType = scriptContext.currentRecord.type;
var sublistName = scriptContext.sublistId;
var sublistFieldName = scriptContext.fieldId;
var line = scriptContext.line;
if (sublistName == 'item' && sublistFieldName == 'item'){
var itemType = currentRecord.getCurrentSublistValue({sublistId:sublistName,fieldId:'itemtype'});
var item = currentRecord.getCurrentSublistValue({sublistId:sublistName,fieldId:'item'});
if (item != '' && itemType != ''){
var expAccount = getExpenseAccount(item,itemType);
if (expAccount == null)
{var expAccountType = null}
else
{var expAccountType = getExpenseAccountType(expAccount);}
if (expAccountType == 'Fixed Asset'){
currentRecord.setCurrentSublistText({sublistId:sublistName,fieldId:'taxcode_display', text:'GST:Capital Purchases', ignoreFieldChange: true});
}
}
发布于 2019-10-01 12:51:17
好了,问题终于解决了。结果,我被NetSuite字段资源管理器插件“欺骗”了,该插件显示字段为“taxcode_display”,但实际的字段为“taxcode”。同样的代码也适用于将fieldid更改为“taxcode”。
谢谢!
https://stackoverflow.com/questions/58162915
复制相似问题