Inventory validation with Order Capture App Sample

Hello, I am using the Order Capture App Sample, and I have been able to edit it so far. What I am trying to do is to validate the Inventory available with the request value. This means when I click on Save the order, I want to get a message like “The order you want to place cannot be saved because is not available in our inventory”, something like that. Since the App sample have the columns Total Available Total Request and Total Inventory, I think this is something I can do, but I dont know how. I am not sure if this is an Action or Behavior, or what exactly is. Thanks for your help.

1 6 584
6 REPLIES 6

Hi @okybrunner,

With the Order Capture sample app, To do that, you need to do:

  1. Create a virtual column in the Order Detail table, lets call this [Total Inventory]

  2. With formua:
    ANY(SELECT(Products[Total Available], [_THISROW].[Product ID]=[Product ID]))

  3. Still in the Order detail table, to the [Quantity], use Valid_If: [_THIS]<=[Total Inventory] and with Invalid value error : "The order you want to place cannot be saved because is not available in our inventory”

The virtual column isn’t strictly necessary:

[_THIS]<=ANY(SELECT(Products[Total Available], [_THISROW].[Product ID]=[Product ID]))

Ahhhhh… I see now… Thanks @Steve

Steve, where should I write that formula?

At the Valid_if of [Quantity], like my step#3.

Thanks for your help, I will try that

Top Labels in this Space