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 :
Microsoft Dynamics AX (Archived)

Validate the city field on form

(0) ShareShare
ReportReport
Posted on by

I have one ListPage form that has field CIty (EDT is LogisticsAddressCity). Now I have to validate that field, so when putting new record that field has to be only city not some random text with no sence.

How can I do that?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    304,553 Super User 2026 Season 1 on at

    Hi Dejana,

    You haven't told us if you are using a custom or a standard form. Standard AX uses the logic which can be setup on the Address setup form. You can define cities per country and also enable City validation on the parameters tab page.

    If it is a customization, try to use the same logic.

  • Basheer17 Profile Picture
    2,720 on at

    For validations you can use modifiedField of table. But how will you validate if the entered value is valid city name. Or if you have city names stored in some table you can use lookup using table relations.

  • Verified answer
    Martin Dráb Profile Picture
    239,399 Most Valuable Professional on at

    No, modifiedField() isn't the right place. The corresponding validation method is called validateField(). modifiedField() is called later, when the change was already validated and accepted.

    Nevertheless using the standard features for maintaining database consistency sounds like a better than writing custom code, unless there are some additional requirements.

  • Community Member Profile Picture
    on at

    My colleague told my that this might be some property on the field on the table. Because when i create new record new form is opened, there I have the field city and I can save whatever I want but Im supposed to not do that, it should save only existing city because the EDT of the field is LogisticsAddressCity.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    304,553 Super User 2026 Season 1 on at

    Hi Dejana,

    Have a look at the LogisticsPostalAddress table. It has to fields for managing the cities. One where you can specify text you like, the other one to check if it is a valid city based on the address setup settings.

    Verify how it has been done in standard and apply similar logic.

  • Community Member Profile Picture
    on at

    Thanks, I changed the EDT to LogisticsAddressCityName and made a relation.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans