web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 251
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)
  • Gerardo Rentería García Profile Picture
    23,153 Most Valuable Professional on at
    How to remove validations on city field on customer card in business central

    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

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    19,085 Super User 2025 Season 2 on at
    How to remove validations on city field on customer card in business central
    You would need to modify the logic that triggers the population of the postcode.
  • Suggested answer
    Jainam M. Kothari Profile Picture
    12,118 Super User 2025 Season 2 on at
    How to remove validations on city field on customer card in business central
    Hello,
     
    It requires Customization for the same.
  • KasparsSemjonovs Profile Picture
    4,615 Super User 2025 Season 2 on at
    How to remove validations on city field on customer card in business central
    This can be achieved only with some development.
     
  • Suggested answer
    Tech-Lucky Profile Picture
    1,259 Super User 2025 Season 2 on at
    How to remove validations on city field on customer card in business central
    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.
     
     
     
  • Suggested answer
    Holly Huffman Profile Picture
    6,520 Super User 2025 Season 2 on at
    How to remove validations on city field on customer card in business central
    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!

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 3,012

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,682 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,328 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans