this is my script based on a saved searched I crea...
# suitescript
s
this is my script based on a saved searched I created how come the same result will show up on two different line (twice )
Copy code
var itemSearchObj = search.create({
   type: "item",
   filters:
   [
      [["type","anyof","Assembly"],"AND",["islotitem","is","T"],"AND",["locationquantityavailable","greaterthan","0"],"AND",["inventorynumber.quantityonhand","greaterthan","0"],"AND",["inventorylocation.internalid","anyof","14"],"AND",["quantityonhand","greaterthan","0"],"AND",["inventorynumber.location","anyof","14"]], 
      "OR", 
      [["type","anyof","Assembly"],"AND",["islotitem","is","F"],"AND",["inventorylocation.internalid","anyof","14"],"AND",["locationquantityavailable","greaterthan","0"]]
   ],
   columns:
   [
      search.createColumn({
         name: "itemid",
         sort: search.Sort.ASC,
         label: "Name"
      }),
      search.createColumn({name: "salesdescription", label: "Description"}),
      search.createColumn({name: "type", label: "Type"}),
      search.createColumn({
         name: "location",
         join: "inventoryNumber",
         label: "Location"
      }),
      search.createColumn({
         name: "inventorynumber",
         join: "inventoryNumber",
         label: "Number"
      }),
      search.createColumn({
         name: "itemid",
         join: "memberItem",
         label: "Name"
      }),
      search.createColumn({
         name: "quantityonhand",
         join: "inventoryNumber",
         label: "On Hand"
      }),
      search.createColumn({
         name: "islotitem",
         join: "memberItem",
         label: "member is lot ?"
      }),
      search.createColumn({name: "islotitem", label: "parent is lot ?"}),
      search.createColumn({name: "memberitem", label: "Member Item"}),
      search.createColumn({name: "memberquantity", label: "Member Quantity"}),
      search.createColumn({name: "locationquantityonhand", label: "Location On Hand"}),
      search.createColumn({name: "locationquantityavailable", label: "Location Available"})
   ]
});
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;
});

/*
itemSearchObj.id="customsearch1701211238374";
itemSearchObj.title="Item Search break down assembly (copy)";
var newSearchId = itemSearchObj.save();
*/
e
Because you have a join that returns several possible values.
s
im trying to find the inv in one location only
it can either be lot controlled or ont