Skip to main content

Notifications

Microsoft Dynamics SL (Archived)

set up a zip code mask for US and Canadian zip codes

Posted on by Microsoft Employee

Hi

We do business with companies in the US and Canada and would like to eliminate the data entry errors associated with miskeying zip codes. Since the zip code syntax is so different between the 2 countries is there a way in SL to look at the Country code and then set a mask fir the zip code?

Thank you

Tom D

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: set up a zip code mask for US and Canadian zip codes

    awesome! thanks Randall, I will give it a try

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: set up a zip code mask for US and Canadian zip codes

    A quick VB customization like this works for the basic changing of the Zip code mask:

    Private Sub ccountry_Chk(ChkStrg As String, retval As Integer)

       If Trim(ChkStrg) = "US" Then

           czip.Mask = "99999-9999"

       ElseIf (Trim(ChkStrg) = "CA") Then

           czip.Mask = "WWW WWW"

       Else

           czip.Mask = "XXXXXXXXXXX"

           End If

    End Sub

    The challenge will be finding all of the places that this code would need to be added. Also, the default layout has the country after the zip code, so the order of fields may need to be changed to make it flow better for the user.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: set up a zip code mask for US and Canadian zip codes

    Hi Carolyn

    I am still looking for a solution to this. I am not a coder but it looks like writing some custom code may be the only solution

    Tom

  • RE: set up a zip code mask for US and Canadian zip codes

    Hi TomD,

    I can test this for you unless you already have found an answer.  Let me know.  Thanks.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans