Sciuridae54696d
01/07/2022, 6:22 AMrequire(['N/record','N/runtime','N/search','N/format'], function(record,runtime,search,format) {
try{
var invLookup = search.lookupFields({type:search.Type.INVOICE,id:105666,columns:['accountingPeriod.arlocked','postingperiod']});
var postingPeriod = invLookup.postingperiod[0].value;
var postingPeriodT = invLookup.postingperiod[0].text;
var abc = 1;
} catch (e) {
var scriptId = runtime.getCurrentScript().id;
log.error('ERROR:'+scriptId+':fn:'+runtime.executionContext, JSON.stringify({type: e.type,name: e.name,message: e.message,stack: e.stack,cause: JSON.stringify(e.cause),id: e.id}));
}
});
you can't get posting period using search.lookupFields for invoices?!
figured it out - pending approval and posting period have this bizarre behaviour