calculate field automatically

0
Hello, I want to automatically calculate my TotalDays data, I have two data, StartDate and EndDate, and once my StartDate and EndDate data have been selected, I want that field to be filled in automatically.
asked
3 answers
1

See the documentation here: https://docs.mendix.com/refguide/between-date-function-calls/#6-daysbetween

So something like daysBetween(StartDate, EndDate)

So create an on change flow that does this calculation and fill the result in TotalDays and refresh your object.

Regards,

Ronald

 

answered
1

Hi Ivan Lopez

In the page/form where StartDate and End Date are input, set their on-change events to call the CalculateTotalDays microflow.

 daysBetween(StartDate, EndDate).

answered
1

Hi Ivan Lopez,

 

Please refer the following screenshot for calculating no of days between

 

1) Create a variable and define as given in the following screenshot

image.png

 

2) In Change Object we use toString functionality converted decimal variable value to string value and round function to give round value

image.png

 

3) Below screenshot give the output for the scenario

 

image.png

Hope this helps, feel free to ask queries if any?

answered