Skip to main content

Notifications

Announcements

No record found.

Supply Chain Management forum
Suggested answer

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

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!!

  • D365_Wibes Profile Picture
    D365_Wibes 184 on at
    RE: Is there any way to use (find All References) option via x++ code

    Thanks again Martin,

    Let me try this and tell you...

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    RE: Is there any way to use (find All References) option via x++ code

    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
    D365_Wibes 184 on at
    RE: Is there any way to use (find All References) option via x++ code

    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

  • D365_Wibes Profile Picture
    D365_Wibes 184 on at
    RE: Is there any way to use (find All References) option via x++ code

    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

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    RE: Is there any way to use (find All References) option via x++ code

    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.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,349 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,212 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans