
I have a Date field in our system, and Users just cannot get the date right... which 90% of the time should be Todays' date. But the other 10%... could be any date.
I would love to create a pop-up alert to warn Users that their date may be incorrect on change of this field.
Basically, if "Date_of_Service" <> Today(), create an Alert "The Date you entered is not Today's Date. Please confirm."
But I don't want to do this On Save, because they still need the option to change or keep that value prior to saving.
My other question is if I need to take into consideration the UTC time of "Today" in Dynamics. So if my User is in the East Coast or Hawaii, how do I determine "Today" as local?
Thanks in advance!
Hi gsfortis,
there are different approaches for this requirement.
If you want to implement client side logic you can work with an "OnChange" handler, as your custom validation will kick in when the date value is changed and will run prior to any save action:
docs.microsoft.com/.../configure-event-handlers-legacy
OnChange Occurs when data in the column changes and the control loses focus.
You can also consider having your validation done on Server side, where you can explore creating a plugin running on Pre-Validation stage. You can review below documentation to get familiar with the different events existing in the execution pipeline.
Finally, for a low code approach you can also consider implementing business rules:
https://docs.microsoft.com/en-us/powerapps/maker/data-platform/data-platform-create-business-rule
Regarding your ask about the date and UTC, it really depends on your requirements.
Depending on how the datetime behavior is configured for your respective date fields/columns, you may or may not need to do additional UTC calculation. Please review below documentation to understand more about the date time behaviors:
https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/behavior-format-date-time-field