Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to know if a class inherits directly from a class

(0) ShareShare
ReportReport
Posted on by 1,550
Hi,
 
There is a drop down fields that has class names
And there is a button
 
I want to say that if the class value chosen inhertits from a certain class then hide this button.
I need to say if it inherits from it directly.
 
So let's say we have base class A
Class B is child of A
Class C is child of B
 
The code needs to say any class that inherits directly from A, then the button needs to be disabled
 
So in this case if we choose class B, button will be disabled
But if we choose class C it won't 
  • Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    How to know if a class inherits directly from a class
    junior AX, please either verify the answer or tell us what else you need to know first.
  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    How to know if a class inherits directly from a class
    Hi Junior,
     
    As Martin told you can make use of Extend method of DictClass. You can also make use of the ExtendedBy which will give the list of class that extend a specified class.
    For more details refer to the below Microsoft Documentation.
     
    Thanks,
    Girish S.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    How to know if a class inherits directly from a class
    You can utilize DictClass.extend() method.

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…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans