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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Carolyn Kolpien Profile Picture
    on at

    Hi TomD,

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

  • Community Member Profile Picture
    on at

    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

  • Verified answer
    Community Member Profile Picture
    on at

    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

    awesome! thanks Randall, I will give it a try

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans