Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

overridelookup method in form control

(0) ShareShare
ReportReport
Posted on by

Hi Team,

I am new to AX and I got stuck while doing the below operation.

I have a Master Table where I have fields - EmployeeID, EmployeeName, Status(Active/No) and child table (LeaveApp)- LeaveID, EmployeeID (FK)

And I have a form for LeaveApp table in which EmployeeID lookup field should display only Active employees.

Could you please guide me how to write the lookup method on the control EmployeeID on the LeaveApp form?

Thanks.

  • Suresh M. Parmar Profile Picture
    340 on at
    RE: overridelookup method in form control

    Hello Martin,

    You are right,

    In that case, only custom lookup is the option.

    For fixed field relation delete action, it will get ignored for inactive status.

    Thanks,

    Suresh Parmar

  • Martin Dráb Profile Picture
    232,896 Most Valuable Professional on at
    RE: overridelookup method in form control

    I'm not so sure. If you use such a relation, select an active vendor employee and then somebody will make it inactive, the data in the table won't match the relation. Sich records will be ignored by queries using this relation, by delete actions and so on.

  • Suggested answer
    Suresh M. Parmar Profile Picture
    340 on at
    RE: overridelookup method in form control

    Hi,

    You need to give the fixed field relation into the LeaveApp table, there is no need to write any custom lookup method.

    Follow SS for reference,

    Link docs.microsoft.com/.../conditional-table-relations

    pastedimage1634106420723v3.png

    Thanks,

    Suresh Parmar

    Please mark verified if get the solution.

  • Suggested answer
    Martin Dráb Profile Picture
    232,896 Most Valuable Professional on at
    RE: overridelookup method in form control

    Hi, I'm assuming that is just for training, because AX already contains a table for employees (HcmWorker).

    As I understand, you didn't use the surrogate key (RecId) for the link - you're using the string field EmployeeId. If so, then overriding lookup(), as you mentioned, is the right approach. Look into documentation to get an idea about how to do it: How to: Add a Lookup Form to a Control.

    By the way, please use Development / Customization / SDK category (not Other) for questions related to development. I've already changed it this time.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,145 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,896 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans