Notifications
Announcements
Hi,
I have a requirement where a custom Date and Time field needs to be populated with the current user date and time on click of the field instead of user manually selecting the date and time.
Using Calculated field with Action Now() leads to the field being populated on form load and that is not what I'm looking for as the field on click triggers a different function. Is there any way I can achieve this?
Any help is appreciated
Thanks,
Rupal
You mean when Calculated field populate your field value then on change event does not trigger which cause javascript associated to onchange on that filed not gets executed. Correct?
Can you try using Business Rule to set current date and time instead of using Calculated field.
Hi partner,
You can also try using workflow or js to populate date time automatically.
1.workflow.
Create an on-demand workflow and populate date field with dynamics value--Execution Time.
2.Js.
function updateDateField(executionContext) { var formContext = executionContext.getFormContext(); var date = formContext.getAttribute("new_date"); var currentDateTime = new Date(); date.setValue(currentDateTime); }
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 93 Super User 2025 Season 2
TAHER_El_Mehdi 30
Satyam Prakash 24