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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Can we skip parents methods in certain classes

(0) ShareShare
ReportReport
Posted on by 1,552
Hi,
 
 
So let's say we have base class A
Class B is child of A
Class C is child of B
 
And let's say the base class A has a method with some
logic called commonMethod
 
In class B that extends A, I don't want to apply the logic in the common method so i overrided it and returned nth
 
Now in class C that extends B...i want the logic of the method in the base class
 
Can i let class C skip B in this certain method and look at the base method?
  • Suggested answer
    Martin Dráb Profile Picture
    241,637 Most Valuable Professional on at
    No, it's not possible. You'll need to look a better design.
     
    For example, class A may have a method that decides whether the logic should be run or not. It would return true in class A, class B would override it and return false and class C would override it again and return true.
     
    Or maybe C shouldn't extend B at all, if the logic of its current parent (B) isn't suitable.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans