Calculating items from multi reference selectors using a microflow or any other method.

0
Hi Everyone. Below is my domain entities.  Then my Noodle Combo New_Edit.  I want to be to calculate the sum of the prices of the three selected items, then display their total in the costofcomb column in the data grid below.  Thanks  
asked
2 answers
2

Hi Asriel,

Take a look at the following lecture (and following), which discusses aggregated data and how  and when to calculate and set the value.

https://gettingstarted.mendixcloud.com/link/module/8/lecture/336

Good luck, Rene

answered
1

Hi Onyayo,

There are several ways to implement this apart from using a calculated microflow and the best method depends in the context you are trying to implement this. Below are couple of methods which can also be used;

1. Add a before commit microflow on NoodleCombo entity and retrieve associations (base, favourites and sauce) and set the value of CostOfComb attribute as sum of three selected items (base/FoodItemName + favourites/FoodItemName + sauce/FoodItemName)

2. Add a custom microflow button (name it save), and in the microflow you can retrieve associations (base, favourites and sauce), do all the required validations and set the value of CostOfComb attribute as sum of three selected items (base/FoodItemName + favourites/FoodItemName + sauce/FoodItemName)

 

Hope this helps!

answered