How to subtract automatically?

After applying for leave for 2 days these days need to be subtract from total leave days automatically. How to achieve this? For example I have total 10 leave days in my account. I have applied a leave for 2 days. Then my total leaves needs to be change from 10 to 8 days automatically. How achieve this requirement in mendix?
1 answers

Hi Ladi,

There are many ways you can go about this solution and it all depends on how your app is built, but here are two that I can suggest:


  1. Use a calculated attribute on the object in question that calculates the remaining leave by using the two other attributes (total leave and applied leave)
  2. If you are just deducting the amount from the value then when you commit the object refresh it as well. That should update the client (page) to have the new value.