Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 365 auto format date time field input

Posted on by 235

We are using CRM 365 on-Premise V8.2, I need a function that auto format user's input on the date time field. For example, on Contact form, if user enters 01011980, I can use script to change it to 01/01/1980. Any suggestion on how to do this?

Here is what I have done so far:

1) On CRM 2011, we have script add onKeyup event to field with className "ms-crm-DateTime". It doesn't work now. So in the Form_load event, I am trying to add the event using Xrm.Page.getControl("birthdate").addOnChange or addOnKeyPress but I always got error says "Property/Method not found". I am not sure what I did wrong.

2) I add change event to the birthdate field from Form editor. The problem is that, this event only fires when the field has an valid value. Also I am not sure how to get the "raw" value of the user input, CRM date time value returns a long string representing CRM date time.

Thanks

Holly

 

*This post is locked for comments

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans