web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Custom lookup error

(0) ShareShare
ReportReport
Posted on by 160

I am getting the following error with a custom lookup method. 

"Failed to execute query because no root data source on the form matches the root datasource on the query"

The main datasource in the form is a temporary table, and the filter I am implementing in the custom lookup uses a separate set of tables, albeit the return type EDT is the same.

Any help appreciated.

 

*This post is locked for comments

I have the same question (0)
  • Ivan (Vanya) Kashperuk Profile Picture
    Microsoft Employee on at

    Try creating a separate form that shows that data, with the same data source setup.

    If that works, you'll just be able to reuse it as your lookup form.

    If it doesn't, in the process you should be able to see the wrong of your ways. :)

    The above sounds incorrect. The EDT has nothing to do with selecting the data.

  • Steve Kirchner Profile Picture
    15 on at

    This error can occur when the wrong TableId is passed in SysTableLookup::newParameters().  Make sure you use the table you want to do the lookup in (not the table you're doing for).

  • Martina Bergamo Profile Picture
    1,470 on at

    The main datasource of your query must be the same as the main datasource in the form.

    If you want to show fields from other tables, you can use this:

    sysTableLookup.addLookupMethod(tablemethodstr(tableName, methodName));  

    where the method is a display method and the table is the same as the main datasource!

    I hope it can help you!

  • Suggested answer
    smith.matrix Profile Picture
    45 on at

    This makes sense..Thank you

  • Martin Dráb Profile Picture
    240,196 Most Valuable Professional on at

    Please mark the helpful reply (replies) as the verified answer.

  • smith.matrix Profile Picture
    45 on at

    "The main datasource of your query must be the same as the main datasource in the form.

    If you want to show fields from other tables, you can use this:

    sysTableLookup.addLookupMethod(tablemethodstr(tableName, methodName));  

    where the method is a display method and the table is the same as the main datasource!

    I hope it can help you!"

  • Martin Dráb Profile Picture
    240,196 Most Valuable Professional on at

    I meant something else. There is a question beside each reply asking "Did this answer your question?" and if you say Yes, it marks the thread as resolved and the reply is listed in the Only Answers view. Nevertheless it's true only if it's your thread; I didn't notice that the question was asked by somebody else than yourself.

  • Sheetal.D Profile Picture
    177 on at

    May i know how the same logic works for sysdatasetlookup?

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

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans