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

Want to show some values on a lookup based on a field in another form in x++

(0) ShareShare
ReportReport
Posted on by 3

In Finance and Operations, I have a field named ScaleID that has been created in the form level in Form1. This field has two methods associated with it. One is jumpref which is responsible for navigating to another form. Another method is edit, this is triggered when this is field switched to edit mode. Most importantly, this field has a lookup which gets value from another form named Form2. In the Form2, I have another field named status included to every record in that form, says that the particular record is active or not. My problem is if the record is active (status to yes) in the Form2, then only that particular record should be displayed in the lookup of the field ScaleID in Form1. If it is not active ( status to no ), then the record should not display in the lookup.

I am expecting the lookup should show only the active records (status to yes) on the lookup of the Form1.

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    Hi, How about adding range on Status to check if record is active in Scale Id field lookup. If there is no lookup method then you can override/extend the lookup method to write code.
  • Mohit Rampal Profile Picture
    12,565 Moderator on at
    I am assuming there is table relation in-place between table that have Status field and the table containing ScaleID field so you can join the tables in lookup method and add range. 
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    If I understand correctly, your problem is to show only active records of form2 when you click on the lookup on ScaleID field on form1.
    Then you can write the code in lookup of that control and give a query to retrieve the active records.
     
    The below link is for your reference.
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    Hi,
     
    Forgot about the form - Lookup will be built based on the table only.
    So form1 and form2 will have separate DataSource which is related to tables.
    So built the look based on the table present on the form 2 DataSource and add active field range to it.
    You can refer to below blog.
     
    Thanks,
    Girish S.
     

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 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans