Calculated attribute gets calculated although its not used on the page!

0
 Hi. There’s a performance issue with our app. We have a microflow that updates many objects and for some reason their calculated attributes get calculated although they’re not used on the page where the microflow action button is.   “Refresh is client” is false. The microflow has no parameters and returns Nothing.   I see that the corresponding HTTP response JSON contains all modified objects in the “commits” property and all their attribute in the “objects” property.   It’s not only unnecessary calculation, but also an unnecessary network traffic. I don’t think it was like this before.   Demo app: https://github.com/basi01/TestMicroflowReturnsAllModifiedObjects Please help.
asked
3 answers
5

Hey Ilya,

The calculated attribute requires a microflow to run, and it doesn’t matter where the microflow is, the calculated attribute will trigger the microflow, every time the conditions for its recalculation meet. 

 

Hope it helps and clears your confusion!

answered
1

Each time an object with a calculated attribute is retrieved, the calculation microflow is run even if it’s not used. 

https://docs.mendix.com/refguide/attributes/#value

Have a look at Mendix best practices MXP001 and MXP002 for more information on the best way to use or remove calculate attributes from your application.
https://docs.mendix.com/refguide/performance-best-practices/#mxp001

I hope this helps.

answered
0

When the microflow updates 50 objects they are sent to the client. When the microflow updates 100 objects they're not sent to the client and their calculated attribute is not calculated. This behavior isn't documented.

answered