How to set automatic restocking of the inventory

Hello there, rookie here. I have an Order Capture app (based on the Order Capture How to app) with a table โ€œCatalogueโ€ of items we hire out columns โ€œNameโ€, โ€œItem Idโ€, โ€œPriceโ€, โ€œStockโ€ etc. A table of โ€œCustomersโ€, โ€œNew Hires/Ordersโ€, with โ€œOrder Detailsโ€ and slices for โ€œOpenโ€ and โ€œCompleted Ordersโ€.

In the Catalogue table I have a virtual column called โ€œRelated Order Detailsโ€ REF_ROWS(โ€œOrder Detailsโ€, โ€œItem Idโ€) and I set up another virtual column โ€œStock Calculationโ€ with formula [Stock] - COUNT([Related Order Details]), which drops the โ€œStockโ€ of the โ€œItem Idโ€ that I add to an โ€œOpen Orderโ€. This works fine but Iโ€™m struggling to find a way to reset the โ€œItem Idโ€ stock to its original value once the Order becomes Complete and the item is returned.

At the moment the only workaround I managed to find is to have the โ€œStockโ€ column (name displayed โ€œRestockโ€) as a stepper number, find each Item Id that was hired and restock it manually. That sets the โ€œStock Calculationโ€ to the right value but Iโ€™d like to know if there is a way to automatically restock an item without having to delete the order and related details once the order becomes Complete? I would like to be able to keep a record of all the Hires we have.

Thank you and apologies for the poem, Iโ€™m pretty new to all this and donโ€™t know how to word things efficiently

Solved Solved
1 3 333
1 ACCEPTED SOLUTION

You may wish to take a look at the reference actions that can implement conditional updates across tables on events such as form save. The sample app below updates children records based on the parent record changes. You could do a reverse way- update parent record โ€œCatalogueโ€ when an Order is complete in โ€œNew Hires/Ordersโ€.

https://www.appsheet.com/samples/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e73-...

View solution in original post

3 REPLIES 3

You may wish to take a look at the reference actions that can implement conditional updates across tables on events such as form save. The sample app below updates children records based on the parent record changes. You could do a reverse way- update parent record โ€œCatalogueโ€ when an Order is complete in โ€œNew Hires/Ordersโ€.

https://www.appsheet.com/samples/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e73-...

Thank you @Suvrutt_Gurjar that worked beautifully!

Thank you for this @Suvrutt_Gurjar , Iโ€™ll give it a try and report back!

Top Labels in this Space