Reactive app(Stock maintainance)

Actually I'm creating a vehicle showroom management app, based on that i have to maintain stocks, if I book a vehicle which means quantity of a respected vehicle will decrease automatically in stock, Moreover if I canceled the order  what I need is Quantity will automatically increase in stock, I don't Know how to made a logic for this. Logic screen short is attached. 

Screenshot (5).png


Hi Premkumar,

You could give your vehicles a status (Booked, Available, etc you can use a static entity to define the statuses).
When a vehicle is being booked you can update the status of that vehicle to booked, then if it gets cancelled you update it to the available status again. Then when you want to count your inventory you just filter on status.

There should be no need for any for each loop on your on click.

Kind regards,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.