hey guys, i am trying to get the internal id "quan...
# suitescript
l
hey guys, i am trying to get the internal id "quantityonhand" and "newquantity" exposed on a saved search using the "formula (text)" as the result and getting "error:invalid expression" as the result. Since i am a n00b at this, anyone have ideas?
b
what are you using for the formula
l
{quantityonhand} -- that's it. I am just trying to display the values in the field, not trying to get anyhting done to that field. The field is unavailable via the drop down in the search.
b
what type of search
m
Is this an inventory adjustment search?
l
yes! using the type "transaction"
m
You need to join from the item or inventory fields
l
unfortunately, those fields are not available in the drop down, so can i use a join in the formula field?
m
You’re not going to get “new quantity” though, I bet.
l
dang
b
they are the fields with ... at the end
look towards the bottom of the dropdown for
Item Fields...
l
right i cna get to that table..but within that table in the search, i can't get the fields "quantityonhand"... i guess maybe they are just called "quantity". lemme run that
b
though like @mattdahse I dont recognize new quantity
m
What you really want is “what did I have before this adjustment line?” and “What do I have after this adjustment line?” and those values are probably not going to be available in a search.
l
new quantity can be calculated using a formula field of taking quanitty on hand + adjustment quantity
Yes, what did I have before this adjustment --- that is exactly what I want
m
Yes, but the problem is that if the adjustment happened yesterday, your “on hand” from today isn’t what you want.
It could have changed for a lot of reasons that have nothing to do with your adjustment since then.
l
yup, it is almost like I need an inventory balance at a point in time
for the ones that i am looking at, there are going to be no other adjustments other than an "inventory adjustment"
nvm, spoke too soon, deleted the mssage
b
anyway, to get on hand in your search formula, add the formula(text) column, then for the actual formula, select
Item Fields...
and then
On Hand
to see how joins should look like
as mentioned before, you are probably doomed searchwise for
newquantity
l
ohhhh, i didn't know i could do that!!!! THANK YOu!
m
But again, that will give you what’s on hand at the moment the search is run. Not what was on hand before the adjustment happened.
l
yup, saved search si going to be live data. which means i need to focus on the inventory detail report.
@mattdahse and @battk - Thank you! Feel free to let me know if you have any other thoughts!
b
my general advice is to avoid trying to calculate historical inventory
there is only pain and suffering
i would rather create a user event script that stores the data in a custom column and search that instead
l
ohh wow....didn't think that would even an option