by synolia

Field Mask will be your greatest ally in formatting your SugarCRM data. This module improves the reliability of your data and saves time for your whole team by allowing you to use input templates to your information fields (zip code, phone number, etc.).

Free 30 day trial
Try it Now

By clicking you consent to share your profile with the developer

#3448 - Suggested Formatting For Optional Extensions

Closed General Question created by djohnson 5 years ago

I want to have a mask that allows for an optional extension. How can I accomplish this? I've tried "(999) 999-9999, x " which doesn't allow for an extension after the x. I've also tried "(999) 999-9999, x 99999" which requires the digits after the x. How can this be made as optional please? Thanks!

  1. synolia member avatar

    synolia Provider Affiliate

    4 years ago

    Hello,

    Sorry for the delai, but yes, it is possible to have multiple masks for one field, that validate the field. The mask to use, in your case, is like follows:

    ((999) 999-9999)|(99999)

    The module will display as default the first mask, but will automatically change to the second one when it detects that the entered value does not validate the first mask anymore but validates the second one. The different masks have to be between paranthesis and separated by the pipe symbol "|".

    If you have any questions, i'll be glad to help.

    Kind regards, Synolia Support

  2. djohnson member avatar

    djohnson

    4 years ago

    Hello. This is what I've decided to go with ((999) 999-9999)|(, x 99999) The digit lengths of extensions vary greatly. Is there a way to make the digit length variable? Or will our users just need to add leading zeroes of the extension is less than 5 digits? ex; (123) 456-7891, x 00012

  3. synolia member avatar

    synolia Provider Affiliate

    4 years ago

    Hello,

    You can add as many masks as you want. So you can for exemple have something like this:

    ((999) 999-9999)|(, x 99999)|(, x 9999)|(, x 999)|(, x 99)

    For shorter phone numbers. Normally the above mask will validate the "x 12" and the "x 00012" as well.

    If you have any assistance, i'll be glad to help.

    Kind regards, Synolia Support

  4. djohnson member avatar

    djohnson

    4 years ago

    After some trial and error, I got this to work the way we wanted with the following mask. Thanks for getting me going in the right direction: ((999) 999-9999)|((999) 999-9999, x 9)|((999) 999-9999, x 99)|((999) 999-9999, x 999)|((999) 999-9999, x 9999)|((999) 999-9999, x 99999)

    • synolia member avatar

      synolia Provider Affiliate

      4 years ago

      Hello,

      I'm glad you found the right mask for your situation. Do you require any further assistance with this issue?

      Kind regards, Synolia Support

    • djohnson member avatar

      djohnson

      4 years ago

      We are all set, thanks.

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
Rating
  • "This module is easy to work with and helps us keep our data and reporting in a format the way we want." - djohnson

    Read More Reviews