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)

Reg two lookups.

(0) ShareShare
ReportReport
Posted on by 475

2018_2D00_07_2D00_05-15_5F00_51_5F00_45_2D0028000E202A20_2_2C20_-_2D00_-_0E202A20_usmf_2C2029000E20_.png

Hi,

I have created the Custom form which has two lookup fields. When i select the first lookup the second lookup is filtered according to it and values are showing according to it.

Now  what i want is when i click on the second lookup also i.e,

For any orderaccount, there will multiple orders and now when I select I a specify PurchId only it should be displayed in the grid.

Please advice.

Regards,

Bharath K

*This post is locked for comments

I have the same question (0)
  • bharathkarunakaran Profile Picture
    475 on at

    Hi,

    I have added the range crispin. Now the second lookup is filter based upon the first lookup.

    But Whenever  I select the select the second the grid is not filtered based on the second lookup .

    Please advice.

    Bharath K

  • bharathkarunakaran Profile Picture
    475 on at

    hI

    can you suggest me some examples

  • Suggested answer
    axk Profile Picture
    925 on at

    You have to add code, which will set range for your datasource query. So you should overwrite executeQuery() method at your datasource and make it look silimilar to this:

    daxprogrammingtips4u.blogspot.com/.../how-to-add-range-in-executequery-of.html

    You should use values from your lookup to set range's value, so it will be filtered by both vendor account and purchase id

    After it is done, you should execute this code every time lookup value is modified. So, overwrite control/datasource field modified() method, and execute DataSource.executeQuery() method.

    https://msdn.microsoft.com/en-us/library/aa607131.aspx

    That's all, grid shall be filtered.

  • bharathkarunakaran Profile Picture
    475 on at

    Hi,

    Thanks for your effort guys,

    Since i am new to ax,

    I cant follow your steps, can you give ,me the code.

    Regards,

    Bharath K

  • bharathkarunakaran Profile Picture
    475 on at

    Yes,

    But i am having only a single datasource and i want to filter based on the two fields in the same datsource.

    How to do that.

    Please explain

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 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans