How to Create a Dynamic System for Value C in My Equation
0
Hello Mendix Community! 😊 I am working on a system to calculate Value Z using the following equation: Value Z = Value A + Value B1 + Value B2 + (Value C1 + Value C2 + ...) Here’s the challenge:I don’t have a fixed number of Value C inputs for my equation. To address this, I’ve created a feature where users can add as many numbers as they want for Value C. I also added a checkbox functionality, so users can select specific Value C entries to include in the calculation. When selected, these numbers will be multiplied together and contribute to the final equation. What I’ve Done So Far: Domain Model:I’ve created an entity for Value C and added a Boolean attribute Overview Page:Users can see all the numbers entered for Value C. Edit Page for Value C:I created a page for users to input new Value C entries. However, I faced issues linking the input fields to the Value C attributes. What I Need Help With: Edit Page:How can I correctly bind the input fields (e.g., number and checkbox) to the Value C attributes? Selection Logic:How can I implement the logic to multiply the selected Value C numbers? I greatly appreciate any guidance or advice on how to set this up. Thank you so much for taking the time to read my post and help me out! 😊
asked
Nur Fadhilah Binte Mohamad Noor
1 answers
0
To connected the input widget with the attributes simply select the datasource for the widgets.
On the page you should be able to retrieve all the records for C with a retrieve by association in a microflow. The use a list operation activity to filter the list by comparing the boolean to be true. Then create a sum for the list using the value. Retrieve the B1object and B2 object and create a new variable Z. In the Z variable add the B1/value +B2/Value + sum_from_the_list and also add the secondmilestone/AValue. The you should have the value for Z.
Associate the microflow with a button to perform the calculation.