0
votes

Up through MS CRM 2015 we have been successfully using jquery.ui to set input and view masks for common address data based on the country of the address. We store these masks with a custom country entity. The default CRM field is hidden. Using JQuery we create a simple textbox and apply the mask to the value in the field based on the country value submitted.

Is there a way to add phone masking to CRM Forms in 2016? Any help is greatly appreciated!

2

2 Answers

3
votes

I'm not sure why you say that CRM 2016 does not allow DOM manipulation. It doesn't allow it any more than any other version of CRM. No DOM manipulation is supported, although nothing is preventing you from doing so, except that Microsoft may completely change the DOM and break everything you customized.

Actually 2016 happens to be the only version of CRM that this actually is possible in a supported manner without using an iFramed Web Resource. Your basic setup with be as follows

In the OnLoad of the form

  1. Retrieve the Country Phone Number Mask
  2. Apply the mask to the field.
  3. Add an OnKeyPress function to the field that removes the mask as the user types.
0
votes

Use a web resource for that. Is the supported alternative version. Manipulating the DOM directly is bad practice as it might change across versions.