Hello together,
I would be thankfull for some help with my topic.
I'm creating a powerapp to manage a warehouse for components we need while producing our machines. For each machine there is a new "shopping cart" with some components that are needed for producing this machine. I built a screen where the warehouseman can add components to the cart and book the cart for one machine that works well. But when the production of the machine is ready, the whole "shopping cart" of components goes back into inventory, so I have to re-book the quantities of components. Here is the point where I'm struggeling with the patch function.
As database I have a sharepoint list with all elements in warehose with its material number as ID, inventory in stock and inventory in circulation.
In a second sharepoint list all removals from stock are listet (these ones from the same shopping cart have the same "Shopping Cart-ID".
Now I'm building a screen, where return of the "shopping carts" can be booked. You can choose one shopping cart id via dropdown on the right top and then the items of this shopping cart are listed in the collection on the left.
Now I need a patch-function, to patch the inventory in stock and inventory in circulation with on-select of the submit-button.
(inventory in stock + quantity of the returned components; inventor in circulation - qnatity of returned components)
I tried this but its not working:
ForAll(
colReturnCart;
Patch(
Elektroteileliste; LookUp(Elektroteileliste;
Value(Elektroteileliste[@Materialnumber])=Value(colReturnCart[@Materialnumber]));
{'Inventory in Stock': Value(LookUp(Elektroteileliste; Value(Materialnumber) =
Value(ThisRecord.Materialnumber)).'Inventory in Stock') + colReturnCart[@Quantity];
'Inventory in circulation': Value(LookUp(Elektroteileliste; Value(Materialnumber) =
Value(ThisRecord.Materialnumber)).'Inventory in circulation') -
colReturnCart[@Quantity]}
)
)
Thank you for helping!
Lukas
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional