web
You’re offline. This is a read only version of the page.
close
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.

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    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.

  • Suggested answer
    Suresh M. Parmar Profile Picture
    340 on at

    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.

  • Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    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.

  • Suresh M. Parmar Profile Picture
    340 on at

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans