Sunday, September 15, 2024

D365CE | Alternative to Input Mask PCF control

It's been quite a while since the input mask PCF control has been retired in Dynamics 365 CE.

I recently had to implement a mask on phone number fields and was disappointed to learn that Microsoft had retired the control and hasn't offered any alternatives.

So I had to look for other options and I came across this Check Phone Number PCF control which I found it to be very comprehensive. You can read the full documentation on github.

Steps and options to configure

  • Once you download and import the solution, you can select the field on which you want to enable the component.
  • The Output format helps you transform to the following:
    • International: +91 87855 85545
    • National: 87855 85545
    • E164: +918785585545
Note: I prefer the E164 format. Sure it isn't readable, but it is easier during search because it is impossible to remember the correct format for all the country codes. Having said that, it depends if you're implementing this for only a particular country, then an International or National format could work better for you.
  • You can setup the default country code. When you enter the number without any code, a default country code is automatically setup.
  • You can also setup a list of allowed and excluded country codes. To setup the allowed country codes, you can follow the list here or check the screenshot for an example: ISO 3166 (alpha 2) country codes needs to be used.
  • You can also specify whether you want to phone call button to be shown and which app must be the default calling app.

Here are some sample numbers I have entered for UAE, Italy and India.



Hope this helps!