Hi Arjan,
Have you considered this:
- Create a calculated attribute under Customer called TotalOpenOrderAmount. Calculate the value (in a microflow) by retrieving all open orders and take the sum of the Prices. You can show this value on your Customer_Overview (datagrid) and Customer_NewEdit (dataView) page.
Hope this helps.
Kind regards,
Tim Vredevoort
Hi Arjan, one approach can be as follows,
1. Create an attribute OrderTotal in Customer entity.
2. Create a MF that takes Order and Customer as input parameters and update the OrderTotal of Customer with the OrderValue of Order $Customer/OrderTotal+$Order/OrderValue
3. Call this MF as sub MF in the MF where you are setting the Customer-Order assc.
PS: Other approaches can involve event handlers or may be setting the OrderTotal as a calculated attribute with a MF that retrieves the assc Orders list and iterates over summing the order values and returning the number.
Hope this gives you an idea on how to proceed. Good Luck!
Thanks for the input! Works now, using a calculated attribute.