web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Input Mask on Phone field

(0) ShareShare
ReportReport
Posted on by 479

Hi,

We have recently integrated Zoom to Dynamics to allow us to make calls directly from the Contact record using Zoom as the provider, by clicking the phone icon on the Mobile Phone field on a Contact record.

There is an issue with the Zoom integration, in that it will only call if the Contact mobile phone record has a country code beginning with a + first. So for example it will work if the Contact number is +1 123456 but wont work if the contact number is 123456.

I have been looking at input masks on the Mobile Phone field as a workaround. The vast majority of our Contacts phone numbers dont begin with '+123' The would just begin with 123. Anyway, testing it in the Sandbox. When I create the input mask with the format +353 0000000000, the +353 appears in the Mobile Phone field on the Contact. However the phone icon does not. I know this relates to ticking the Web Phone or Tablet Controls in the form properties. But my question is how to I keep the input mask and the phone icon in the form?

Thanks a lot

Ted

I have the same question (0)
  • Verified answer
    Nya Profile Picture
    29,060 on at
    RE: Input Mask on Phone field

    Hi Ted,

    Are you referring to the phenomenon in the screenshot below?

    pastedimage1650616655498v1.png

    Here is a blog about it which also mentioned this issue:

    6 Custom Controls in Power Apps for Data Visualizations - (crmheidi.com)

    pastedimage1650616900920v2.png

     

    1. You can create a JavaScript web resource.

    Here is the code for a similar case.

    function FormatPhoneNo(executionContext) {
    try {
    var formContext = executionContext.getFormContext();
    var nvsField = formContext.getAttribute("telephone1").getValue();
    var nvsTmp = nvsField;
    if (typeof(nvsField) != "undefined" && nvsField != null) {
    nvsTmp = nvsField.replace(/[^0-9]/g, "");
    switch (nvsTmp.length) {
    case 10:
    nvsTmp = "(" + nvsTmp.substr(0, 3) + ") " +
    nvsTmp.substr(3, 3) + "-" + nvsTmp.substr(6, 4);
    break;
    default:
    alert("Phone must contain 10 numeric digits.");
    break;
    }
    }
    context.getEventSource().setValue(nvsTmp);
    } catch (err) {
    alert(err.message);
    }
    }
    1. Open the JavaScript to the Quick Create Form of Contact entity and click the Form Properties.

     Image

    1. Add the JavaScript to the Quick Create Form and set the Event Handle as the image below.

     Image

    1. Add the function.

     Image

    1. Save and publish the form.

    Then the Phone Number will be masked as the format: (xxx) xxx-xxxx.

    Image

    And if a number which has been input does not contain 10 digits, there will be prompt popping up.

    Image

    You need to modify the code yourself for the specific format.

  • TedW Profile Picture
    479 on at
    RE: Input Mask on Phone field

    Hi Nya,

    Many thanks for your suggestion. Its very useful. However my main issue is I believe with the Zoom code. In your first screenshot above, the is no icon on the mobile phone field. I have the phone icon on the Mobile Phone field, but it only launches Zoom if the Country Code, in the majority of our contacts this will be +353, is before it the number. And the vast majority of our Contacts dont have +353 in the mobile phone field. Im not too sure how I would amend your code to reflect that.

    Thanks

    Ted

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 58

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 16 Super User 2025 Season 2

#2
CU29080825-0 Profile Picture

CU29080825-0 16

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans