Skip to main content

Notifications

Announcements

No record found.

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

  • Sheetal.D Profile Picture
    Sheetal.D 177 on at
    RE: Custom lookup error

    May i know how the same logic works for sysdatasetlookup?

  • Martin Dráb Profile Picture
    Martin Dráb 231,321 Most Valuable Professional on at
    RE: Custom lookup error

    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.

  • smith.matrix Profile Picture
    smith.matrix 45 on at
    RE: Custom lookup error

    "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
    Martin Dráb 231,321 Most Valuable Professional on at
    RE: Custom lookup error

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

  • Suggested answer
    smith.matrix Profile Picture
    smith.matrix 45 on at
    RE: Custom lookup error

    This makes sense..Thank you

  • Martina Bergamo Profile Picture
    Martina Bergamo 1,470 on at
    Re: Custom lookup error

    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!

  • Steve Kirchner Profile Picture
    Steve Kirchner 15 on at
    Re: Custom lookup error

    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).

  • Re: Custom lookup error

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans