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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Can we add display methods or simple methods in a dynamic query in x++?

(0) ShareShare
ReportReport
Posted on by 206
Hi experts,

I am just following to know if we can use display methods/simple methods in a dynamic query in x++. By dynamic query I mean, the query which we create it using x++ code. Please share you suggestions if it's not possible then what alternative we can take.

More precisely, here is the image what I want to say:

I have the same question (0)
  • GirishS Profile Picture
    27,825 Moderator on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Yes, you can join it in your lookup query. It's just a normal dynamic query you will be writing in classes, jobs etc.
    There is no difference when it comes to lookup. You just pass your final query to parmQuery method of the SysTableLookup.
    It will display the lookup data based on the query DataSource added with filter - joins added.
     
    Thanks,
    Girish S.
     
  • Martin Dráb Profile Picture
    236,160 Most Valuable Professional on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Please create a new thread for your other question.
     
    This topic is about "Can we add display methods or simple methods in a dynamic query in x++?" and the verified answers are related to that. It would be chaotic if we changed the topic (and either have open questions in an answered thread or even verified answers unrelated to the topic).
  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Yes, there are many blogs like below regarding multiple tables used in lookup
     
    http://axraja.blogspot.com/2016/09/create-lookup-from-multiple-tables.html?m=1
  • Arif Hussain Profile Picture
    206 on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Sir GirishS , Mohit RampalMartin Dráb,

    As always you helped me and I am really grateful to you all. 

    What if my lookup contains multiple table like CustTable and CustTrans. Can we join it using SysTableLookup? 
  • Verified answer
    Martin Dráb Profile Picture
    236,160 Most Valuable Professional on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Note addLookupMethod() doesn't add a display method to a query. It just tells SysTableLookup class to run the method on table buffers returned by the query.
  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Hi Arif, You can use addLookupMethod. Check this thread.
     
  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    Can we add display methods or simple methods in a dynamic query in x++?
    Hi Arif,
     
    You can use sysTableLookup.addLookupMethod(tableMethodStr(TableName, MethodName));
     
    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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,370

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 675 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans