Background overwriting value selected from dropdown.

0
In my application when user is creating a new "quote" he needs to select from drop down a Product type (product) and as one of the options annual running hours (AnnualHours)    in my microflows all those values are then considered to calculate total cost of service.   I need to create a logic that for a specific product (Dryer) microflow will replace any selection with 8000 hours as we need 1 yearly service despite running hours.   below is my apporach but I'm doing something wrong as 1 logic doesnt work and it also adds some "0" value entries to a dropdown table so next time I'm selecting the running hours I have some additional ones with 0.   What would be best practice in this case?   I also tried adding a decision point to check if it is a Dryer or not and then if not continue with happy flow and if yes somehow "push" 8000 as annual hours. 
asked
3 answers
0

Not sure how your domain model functions but yoou could simply overwrite the annuala hours by setting the annualhours like below:

if $Product/Producttype = 'Dryer' then 8000

else

$annualhours/annualhoursint

answered
0

Hello Maciej Bedlin,

 

Seems Quote is your entity and ProductType and AnuualHours are attribute for that.

 

You can add all your logic inside microflow which can be trigger in Submit button or in filed level on change. On leave event. Also, You can create variable in microflow and calculate some value required in your app.

If you want to add special logic for product (Dryer) then in microflow you can check what produst type are selected and add your logic accordingly.

answered
0

Hi @RAJU

 

that all makes sort of sense... but for somebody that never used Mendix it still is a bit of a black magic..

could you be more specific? Microflow is the way I was thinking and would I then just replace the Annual hours with that Microflow?

 

also this will require changes to all the logic that follows and is using the current AnnualHours for follow up calculations? the section from the screenshot is maybe 3%-5% of the whole flow 

answered