hi, i am going through a issue on item record i ...
# suitescript
r
hi, i am going through a issue on item record i want the quantitty available for the prefrerred location now when i do a search , it gives back total quantity availble at all locations but i only want for preferred so i try to load the record but i run out of script useage limits i take values through client script and pass it to suitelet .. and return a flag.. is there a way around this?
s
1. It would be better to post the giant block of code in a thread rather than taking up the whole channel 2. I did not read the code bc I dont think its relevant to this question, you can get only the preferred location's on hand fairly simply
Copy code
var itemSearchObj = search.create({
   type: "item",
   filters:
   [
      ["formulanumeric: CASE WHEN {inventorylocation} = {preferredlocation} THEN 1 ELSE 0 END","equalto","1"]
   ],
   columns:
   [
      search.createColumn({
         name: "itemid",
         sort: search.Sort.ASC
      }),
      "locationquantityonhand"
   ]
});
I see you said available instead of on hand, same concept
r
thank youu, and sure i will remember that next time
hi after a long time trying.. location on hand is not same as quantityavailable quantityavailable groups everything together and just doesnt give for a preferred location ..whatever i do
m
locationquantityavailable after setting inventorylocation to your preferred.
s
To get things from the location sublist on item records, they are all like
locationWhateverYouWant
, those are the not the same as the ones that sum over all the locations
r
thanks you!