Hi, I am looking to exclude transactions (Item Re...
# suitescript
m
Hi, I am looking to exclude transactions (Item Receipts and Inventory Transfers) that are in A/P,A/R,GL Locked periods. How could this be done via a Saved Search or verify using a field on the transaction itself during an Map/Reduce script?
d
First search for the locked periods, then exclude transactions by those date ranges.
m
Yea that would do it!
d
Copy code
require(['N/query'],function(query){
  var sql="select * from accountingperiod where closed = 'T'";
  var results = query.runSuiteQL({query: sql, params: []}).asMappedResults();
console.log(results);
})
m
much appreciated my good sir!
s
things get more tricky if you have multiple subsidiaries that close independently.
m
great point @stalbert!