Inventory App

Good day ,

I was using this app from appsheet as a example .

https://www.appsheet.com/samples/Scan-items-with-quantities-to-keep-a-running-inventory-count?appGuidString=34ce39f0-3fde-4faf-950c-cfedb1274b97

But is there away to make it that a user cannot make the inventory stock go into a negative ?

Regards
Liam

Hi @Liam_663
You can set the valid if of your quantity sold column.

2 Likes

Thank you very much for the Reply Lynn.

However I keep getting a error that the column cannot be located.


Hi @Liam_663
This was just an example from my app. Your column names may be different.

1 Like

Hi Lynn ,

No my Column names are the same , is your Current Stock a Virtual table ?

This is how the data is set up


Hi @Liam_663
I have a current stock column in my sales table as well(I probably shouldn’t have two columns with the same name) it is another virtual column which has this formula
ANY(SELECT(Products[Current Stock],[Product Barcode] = [_THISROW].[Product Barcode]))

2 Likes

@Liam_663
You may check out the Stock management2 app demo
here
https://www.appsheet.com/portfolio/129805

2 Likes

Hi @Liam_663

@Lynn just exposed how to get the current stock with a virtual column

ANY(
  SELECT(Products[Current Stock],
    [Product Barcode] = [_THISROW].[Product Barcode]
  )
)

You may want to try this expression as well in the valid_if of the column [Quantity], from the table Sales:
[Quantity]<=[Product barcode].[Current Stock]
Because your Product Barcode si of type Ref, you can use dereference expression to get its current stock.

Please see also:

1 Like

Hi again @Liam_663

At looking at previous posts, I found this one:

If my understanding is correct, you ask the exact same question, twice: this is redundant.
I understand you did not find out how to solve your situation, but a simple reminder would have done the job :slight_smile:

I understand also that you are very new to AppSheet, this is why I suggest you have a look to this post explaining good practices on the community:

So, I wish you a warm welcome, and can’t wait to see if you managed to solve your situation ! :cowboy_hat_face:

1 Like