Assuming you have an entity called Delivery with 3 attributes:
- Delivery Days
You can use the addDays function (https://docs.mendix.com/refguide/add-date-function-calls#6-adddays-utc) in your change object action in a microflow for attribute DeliveryOrderDate.
In case you cannot see the image below, the attribute DeliveryOrderDate is set to: addDays($OrderDate, $DeliveryDays)
Hello, thanks for your reaction. I already found this function but I don't know how to use it and where to use in a microflow. Doy you maybe have an example to clarify?
Be wary of using calculated attributes, they can cause performance issues and the calculation is done every time the object is used regardless of whether the attribute is used or not.
You can set this date with a microflow whenever it makes the most sense for your process. This can be calculated on a recurring basis via a scheduled event, or you can set this as soon as the order date is set or as soon as a supplier is associated via on-change action or through a microflow tied to a a user action like a “save/continue” button as an example. Lastly this could possibly be calculated via a data view with a source of microflow if you must calculate this and display to user once they view the page and you cannot calculate it before hand as mentioned in the previous option.
In all microflows you can change the date within the Change object action for the object that contains the attribute you wish to set.