Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Dynamics 365 input field mask

(0) ShareShare
ReportReport
Posted on by 5

Current CRM is Microsoft Dynamics 365 Version 1612 (9.0.9.4)

Hi, everyone. 

Default input field mask doesn't work on concrete version. 

What is the best way to set input field mask (as phone/email mask) in CRM?

Is it possible to do via javascript and if it is, what steps should I do?

Some cases with jquery and jquery.inputmask doesn't work because of default crm jquery overwrite custom one.

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Dynamics 365 input field mask

    Hi partner,

    Thanks for your sharing and solutions.

    If your question has been resolved, please close this thread to help other more users with simialr issues.

    Best Regards,

    Leo

  • Suggested answer
    hib Profile Picture
    5 on at
    RE: Dynamics 365 input field mask

    Solutuion is:

    1) Use Inputmask.js

    2) Use method $("#attributeName_i", window.parent.document).mask(maskFormat);

    Special property "window.parent.document" is neccessary because D365 keeps scripts in separate window (frame)

    It should helps

  • Suggested answer
    Shanon012 Profile Picture
    10 on at
    RE: Dynamics 365 input field mask

    Even I was also experiencing the same issue.The community dynamics forum helped me out in resolving my issue.I have another related
    question in this regard. I am totally unable to log in to Microsoft office 365 in Mac Air.
    I have gone ahead and checked all the configurations and settings and also followed basic
    steps to resolve the issue  login office 365 Please suggest me if I have anything to add on to it.

  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Dynamics 365 input field mask

    Hi partner,

    Since "addOnKeyPress" function had been deprecated, we could not match the format when entering each number/letter, but we could use js code to check the value format after we entering the value immediately.

    For example I want to chekc if the email feild format is "xxx@xxx.com" , we could use the following code. We add the function on the emial field's onchange event or form onsave event.

    function formattEmail(executionContext) {
        var formContext = executionContext.getFormContext();
        var Email = formContext.getAttribute("new_Email").getValue();
        var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        if (!reg.test(Email)) {
            Xrm.Page.ui.setFormNotification('Wrong Email format!'"ERROR")
            return false;
        }
    }

    pastedimage1575440314374v1.png

    pastedimage1575440418143v2.png

    As we can see in the above pictures,  this feature works well in both UCI and Classic client.

    About input mask control, I also tried in my instance(Version 1710 (9.1.0.10334) online 2019 wave 2) and it only worked in UCI not Classic client.

    Hope it helps.

    Best Regards,

    Leo

  • Suggested answer
    ashish12 Profile Picture
    3,079 on at
    RE: Dynamics 365 input field mask

    Check the latest notes from D365 in docs about input field mask control.

  • hib Profile Picture
    5 on at
    RE: Dynamics 365 input field mask

    no, it doen't help, as I said default solution doesn't work with concrete version

  • Suggested answer
    Srikanta Mahapatro Profile Picture
    190 on at
    RE: Dynamics 365 input field mask

    Hi,

    Can you try if the link helps https://community.dynamics.com/.../input-mask-on-d365-control

    Please mark as verified if the answer is helpful.

  • hib Profile Picture
    5 on at
    RE: Dynamics 365 input field mask

    It is all about web version, not mobile/talbet

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans