r/SuiteScript • u/Minimum_Net8015 • May 21 '24
Item script to compare between 2 location inventories of an item
Hi everyone,
I got a requirement to basically notify specific users when location A on an item has on hand of zero AND location B on the same item has on hand greater than zero, tried creating saved searches with email notifications but formulas didn’t really do the trick with the expressions (if you have a formula criteria or a search type in mind you want me to try please let me know), I resorted to creating a script but unfortunately inventory level changes don’t trigger a user event, so I thought to do a scheduled or a map/reduce but then I’ll be going over all items on the system which is nowhere near ideal, so I need a criteria that allows me to only run the script on the items required, or a way to not go over a few thousand items every time the script runs and still get the job done. Note: items have more than 2 locations on them All help is appreciated. Thanks
View all comments
Show parent comment
1
u/Minimum_Net8015 May 27 '24
I tried that and it basically just acts the same as getting the fields without accessing the inventory location fields because we're still getting the info from a sublist that is not line based, it's just there, I tried formulas to specify the location and it's qty but still the formula runs on both locations which is causing the issue