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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Lookup validation in X++

(0) ShareShare
ReportReport
Posted on by 30

Hi all,

I have a checkbox and a lookup field, when the checkbox is yes, the user is not allowed to type in the lookup field directly (like entering the data manually in the field) instead they should choose the data from lookup and if they typed it manually it needs to throw error.

how to do in X++ ?

Thanks

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    What are you trying to achieve here? You should not stop manual entry like that, I am assuming what you need is to validate if the value is correct which needs to be done in the Validate method and not lookup.

  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi

    Why don't you have one checkbox field , one Lookup field (reference group), and one textbox.

    Based on the checkbox you disable and hide the control you want.

    Regards,

    M

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    Just put your code in validateField() or validateWrite() method of the table.

    Whether the user selected "foo" from the lookup or typed "foo" should not make a difference and you should not try to block one of them.

  • Gunjan Bhattachayya Profile Picture
    35,429 on at

    Hi WayToD365FO,

    If you have a lookup field, you will always need to choose values from the lookup values. Correct? I would think that this field is linked to a master table and the values selected in the field would be validated.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    308,247 Super User 2026 Season 2 on at

    Hi WaytoD365FO,

    For what reason do you have this requirement? Why should a person choose from the lookup if typing could be in some cases be done quicker? If there is a table relation, there is a default validation if the value exists anyway.

    Blocking the lookup control for manual entry, but allowing the lookup is not possible unless you create a separate button for the lookup.

  • Martin Dráb Profile Picture
    241,637 Most Valuable Professional on at

    A lookup form is just an assistance for users who don't know the value to use. But if they want to paste a value copied from another place, or even type it manually, they should be able to do it. Another common use case is typing just a part of value and then opening a lookup form with a filtered list of values.

    Your design would prevent all these things, making your system much less useful.

  • WaytoD365FO Profile Picture
    30 on at

    Thanks for your replay to all,

    sorry for delay replay.... give us a your solution is that only for two status based not a all lookup and

    i give it to "Lookup only property"  its an impact all lookup what could be causes and resolution ?

  • nmaenpaa Profile Picture
    101,174 Moderator on at

    Hi WaytoD365FO,

    unfortunately I don't understand your latest message. Could you try to describe your question in a clearer way? 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 213

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans