In Business Rules or Business Process Flows, is it possible to set a column value into the current date time?
I tried using a Formula Column to use UTCNow, however it's volatile and recalculates every time.
I would like to record the current date time to a field, and have it be static.
It's relatively simple in canvas apps using Patch, but is it possible in Model Driven Apps?
Hi @noelflores ,
Couple of things that may help;
1. CreatedOn does keep a note of the Date and Time of the record creation and will stay static always.
2. In-case you need to store CreatedOn on some other DateTime or Date field then you can simply use BR/Flow/JS/Workflow/Plugin to populate the field with respective Data.
3. If you are using BR, note it will trigger every time and stay active, so you need to keep a detection whether the custom field is Blank then set current time (You may encounter incorrect dates or invalid bcz your utc and local time may vary or the offset doesn't fall in proper range due to an offset).
4. Better way is to create a Flow that will trigger when record is created and then update the same record with utc() into your custom Field. (Note: CreatedOn is a system field cannot be modified so custom field is needed).
5. You can try Plugin as well to update the records faster.
6. JS is an option but I'd not recommend in-case you import your data, the date field won't be updated as JS requires context.
Hope this helps
Thanks, so I was thinking of using the Created On to calculate the difference from another date time value.
As in a powerfx patch statement: DateDiff(Created On, Now(), TimeUnit.Minutes) to get the duration in minutes.
But, is it possible in a Business Rule/Business Process Flow?
Hi @noelflores ,
You could use the 'Created On' field directly, which records when the record was created.
Best Regards,
Bof