Hi Guys, how to get items quantity on the basis of...
# suitescript
m
Hi Guys, how to get items quantity on the basis of last changed how do i get this i have wrote this but its not working
Copy code
var itemSearchObj = search.create({
   type: "item",
   filters:
   [
      ["inventorylocation","anyof","1"], 
      "AND", 
      ["matrix","is","F"], 
      "AND", 
      ["internalid","anyof","48642","48643"], 
      "AND", 
      ["modified","after","2020-7-8 7:00"]
   ],
   columns:
   [
      search.createColumn({
         name: "itemid",
         sort: search.Sort.ASC,
         label: "Name"
      }),
      search.createColumn({name: "internalid", label: "Internal ID"}),
      search.createColumn({name: "locationquantityavailable", label: "Location Available"}),
      search.createColumn({name: "inventorylocation", label: "Inventory Location"}),
      search.createColumn({
         name: "internalid",
         join: "inventoryLocation",
         label: "Internal ID"
      }),
      search.createColumn({
         name: "name",
         join: "inventoryLocation",
         label: "Name"
      }),
      search.createColumn({name: "modified", label: "Last Modified"})
   ]
});
var searchResultCount = itemSearchObj.runPaged().count;
log.debug("itemSearchObj result count",searchResultCount);
itemSearchObj.run().each(function(result){
   // .run().each has a limit of 4,000 results
   return true;
});
s
I would suspect
["modified","after","2020-7-8 7:00"]
is the problem
a
The last time an Item changed does not necessarily means its quantity changed. My recommendation is you take a look at other inventory properties of the Item.
m
Guys, Thanks for you response, I have found field called quantityavailablechangedate.