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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Is there any way to use (find All References) option via x++ code

(0) ShareShare
ReportReport
Posted on by 184

HI All,

I have a requirement where I need to know how many objects in AOT uses my class or form dynamically.

I know there is an option of Find All references via which it is possible. But I want to do the same via code.

Can it be done? 

Please suggest me if at all there is any possibility.

Thanks in advance!!

  • Suggested answer
    Martin Dráb Profile Picture
    241,509 Most Valuable Professional on at

    You can use code (SQL, LINQ...) to query tables in DynamicsXRefDB.

    Note that this database is used for development. It's not available in non-development environments.

  • D365_Wibes Profile Picture
    184 on at

    Hi Martin,

    Thanks for the response.

    Can you please give me some sample code?

    And via that I can achieve all reference right?

    For Ex:

    If I have created classA

    Then I ll get al the objects whichever is using (classA) .  Correct?

    Please suggest me some sample code .

    Thanks

  • D365_Wibes Profile Picture
    184 on at

    Sorry I mean via the code will i get all the list of forms whichever is using my selected tables?

    Please suggest some sample code please

  • Suggested answer
    Martin Dráb Profile Picture
    241,509 Most Valuable Professional on at

    Try something like this (T-SQL):

    select RefNames.Path from [References]
    join Names as RefNames on RefNames.Id = [References].SourceId
    join Names as FindNames on FindNames.Id = [References].TargetId
    where FindNames.Path = '/Tables/CustGroup'
    and RefNames.Path like '/Forms/%'

  • D365_Wibes Profile Picture
    184 on at

    Thanks again Martin,

    Let me try this and tell you...

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

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 136 Super User 2026 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 110 Super User 2026 Season 2

#3
Aayush Tiwari Profile Picture

Aayush Tiwari 37

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans