currentdatetime + number of days

1
Hi I want to add a date field as an attribute in an entity in the domain model. The default value should not be CurrentDateTime but CurrentDateTime + 5 days. How do I do that? What is the expression to fill in in the default value field?
asked
2 answers
2

I think that you need an after create or before commit event for such a specific case

answered
1

I guess you don't have to store it into the database. If that's true, you can use a virtual attribute otherwise you can use Michel's answer.

If you double click on the attribute, you can set the source on 'microflow'. Then you can select a microflow which calculates your attribute based on CurrentDateTime + 5 days. Every time on show of the attribute, the microflow will be called and your calculated value will be shown. More documentation can be found here, and here:

"If the source is a computation, the microflow property defines which microflow defines this computation to calculate the value of the attribute when the object is retrieved. The microflow should have a parameter of the type of the entity of the attribute and it should return a value with the same type as the attribute."

answered