Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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
    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
    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
    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

  • Carolyn Kolpien Profile Picture
    on at
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

#1
Community Member Profile Picture

Community Member 136

#2
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 102 Super User 2025 Season 1

#3
REUser Profile Picture

REUser 8

Featured topics

Product updates

Dynamics 365 release plans