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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to remove validations on city field on customer card in business central

(4) ShareShare
ReportReport
Posted on by 321
Hi Guys,
 
In our default functionality,when we select city then post code is autopopulated on customer card.
I want to remove this functionality/validation.
output :post code sholud be empty when i enter on city.
Is any way to do this.
 
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,554 Super User 2026 Season 1 on at
    Good morning, afternoon, or evening depending on your location!
     
    To remove the validation that automatically populates the Post Code field when the City field is entered on the Customer Card in Business Central, you can modify the behavior using AL code. Here's how you can achieve this:
     
    Steps to Remove Validation
    1. Create a Table Extension:
      • Extend the Customer table to override the default behavior of the City field.
      • Remove or modify the OnValidate trigger for the City field.
        Example AL Code:
        tableextension 50100 CustomerExtension extends Customer
        {
            fields
            {
                field(50101; City; Text[50])
                {
                    trigger OnValidate()
                    begin
                        // Do nothing to prevent Post Code from being auto-populated
                    end;
                }
            }
        }
    2. Customize the Page:
      • Extend the Customer Card page to ensure the modified behavior is reflected in the UI.
        Example AL Code:
        pageextension 50101 CustomerCardExtension extends "Customer Card"
        {
            layout
            {
                addlast(Group)
                {
                    field(City; Rec.City)
                    {
                        ApplicationArea = All;
                    }
                }
            }
        }
    3. Test the Changes:
      • Deploy the extension and test the City field on the Customer Card.
      • Verify that entering a value in the City field no longer auto-populates the Post Code field.
     
    Alternative Approach
    If you want to retain the default functionality but allow manual entry in the Post Code field:
    • Use a custom field for the Post Code and map it to the original field only when needed.
    • This ensures the default validation logic does not interfere with manual input.
     
    Hope this helps some!
  • Suggested answer
    Tech-Lucky Profile Picture
    1,271 Moderator on at
    You can do this easily by creating an event subscriber for the OnAfterValidate trigger of the City field, and then setting the Post Code field to blank within that subscriber.
     
     
     
  • KasparsSemjonovs Profile Picture
    4,817 Super User 2026 Season 1 on at
    This can be achieved only with some development.
     
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,732 Super User 2026 Season 1 on at
    Hello,
     
    It requires Customization for the same.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,128 Super User 2026 Season 1 on at
    You would need to modify the logic that triggers the population of the postcode.
  • Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Custom Address formats in Countries/Regions

    Custom Address Formatting - FORNAV

    Best Regards
    Gerardo

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans