How to create an Inventory database with Number of Items increment

0
Hi I am trying to build a database for my project wich has an Inventory. The inventory database has categories. That I managed to do by using a seperate entity to store category values. But what I dont understand is how to have a count of number of specific items in a single category. For example there is a category named "Saws" and items to this category will be added like "wood saw" "chain saw" etc.  But what I need is to count the number of "wood saws" added. I can create a form input and a field in the data table named "Number of Items", but how do i make that work?? Like  I mean if we added 10 wood saws via the form, the number of items will be 10.. And If i again added 5 wood saws, the number of items should be incresed to (10+5) =15..  Please help
asked
1 answers
1

Create a domain model like the one below. Create an after commit action for "Item" to retrieve the ItemCategory, then retrieve all of the Item(s)  asssociation to the ItemCategory, then aggregate the list using a COUNT function. Stamped that value into the "NrOfItems" attribute within the ItemCategory. Example microflow can be found here: https://modelshare.mendix.com/models/271d2b98-7dad-4411-8375-65d53bb36aeb/determine-nr-of-items

answered