cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Arioule
Helper III
Helper III

how to add an international dialling code Dropdown List embedded within a Phone Number Type Field

Hi, 

 

I would like to use in my Entity Main Form a Phone Number Type Field where you can select an international dialling code ?

 

How can I do that ?

 

Thanks,

 

Arioule

2 ACCEPTED SOLUTIONS

Accepted Solutions
ben-thompson
Solution Sage
Solution Sage

To do that you will need to create a PCF component as that would be the only way of using a drop down alongside the phone number textbox within an existing field.

 

While there isn't a PCF component that does exactly what you want https://pcf.gallery/phone-number-by-country/ adds a the country flag using the country code (which may help) https://pcf.gallery/check-phone-number-control/ will validate the number is correct for that country.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

@Arioule if your requirements are a little flexible I would try to leverage out-of-the-box options rather going via the customizations route like PCF. If you can't have a separate optionset field, then you can easily format to phone and enforce a international code with the Input Mask control. Here are the quick steps:

  1. Open your solution that contains that entity and open the main form. Click the "switch to classic" button on the top
  2. Select the phone number field and click "Change Properties"
  3. Navigate to the Controls tab and click on "Add Control"
  4. Select "Input Mask" and click add
  5. Pick you field for the Field property
  6. Enter the desired mask (e.g. 00-000-0000) for the Mask property.
  7. Ensure the Input Mask control is selected for Web, Phone and Tablet.
  8. Save all and publish all customization
    2020-06-20_10-09-00.png

 

View solution in original post

6 REPLIES 6
EricRegnier
Super User II
Super User II

Hi @Arioule, do you want to select an international dialing code from another field like an optionset (dropdown) or you would like to validate your current phone number field to have the international dialing code? Thanks

ben-thompson
Solution Sage
Solution Sage

To do that you will need to create a PCF component as that would be the only way of using a drop down alongside the phone number textbox within an existing field.

 

While there isn't a PCF component that does exactly what you want https://pcf.gallery/phone-number-by-country/ adds a the country flag using the country code (which may help) https://pcf.gallery/check-phone-number-control/ will validate the number is correct for that country.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

View solution in original post

@Arioule if your requirements are a little flexible I would try to leverage out-of-the-box options rather going via the customizations route like PCF. If you can't have a separate optionset field, then you can easily format to phone and enforce a international code with the Input Mask control. Here are the quick steps:

  1. Open your solution that contains that entity and open the main form. Click the "switch to classic" button on the top
  2. Select the phone number field and click "Change Properties"
  3. Navigate to the Controls tab and click on "Add Control"
  4. Select "Input Mask" and click add
  5. Pick you field for the Field property
  6. Enter the desired mask (e.g. 00-000-0000) for the Mask property.
  7. Ensure the Input Mask control is selected for Web, Phone and Tablet.
  8. Save all and publish all customization
    2020-06-20_10-09-00.png

 

View solution in original post

@EricRegnier How do you use an input mask when phone number lengths and formats differ across countries - for instance the US has a 3 digit area code, the UK has 3 or 4 digit area codes depending on the area.

 

That was why I suggested PCF components as this is a problem where a mask will instantly fail once you leave the USA and equally a solution that was been fixed by various Javascript libraries over the past 20+ years. 

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Hi @ben-thompson,

 

Thanks a lot

Hi @EricRegnier,

 

Thanks a lot.

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,353)