I have an Order which has a list of Line Items each Line Item has one Related Product
Order, Line Item, Product are data types.
Line Items has a data field Quantity and Product has a data field Inventory, both are numbers
Now; I want a database triggered workflow that allows me to modify the inventory when a Order changes the Order Status ( defined as a Option Set) in a way that before change Product´s Inventory minus the Line item´s Quantity.
I somehow am not able to get this right.
Could please anyone advise on how to tackle that problem
If you’re using a database trigger event that’s watching changes to your Order data type, you could do…
Condition on trigger event: Only when Order Before Change’s Status is not Order After Change’s Status (and Order After Change’s Status is [status you’re watching for])
Action: schedule a new API workflow on a list –
type of list: line items
list data source: Order After Change’s list of line items
make sure the new API workflow has a parameter for Line Item so you can send “This Line Item” in the schedule action
Action within new workflow:
Make a change to line item’s related product
Quantity = this product’s inventory minus line item’s quantity
So basically what’s happening is when the order status changes, you schedule a new workflow on the list of line items. That way the new workflow can work with each product/line item relationship individually.
thanks for coming back to me. Maybe I am missing something but I can´t get it to work.
So just that you understand …
“Lagerbestand” = inventory and Anzahl = quantity (of the line Item)
at the end I got it, I made the mistake that I thought that I had to relate to new Order
but now it´s working perfectly. thanks one more time for your help.