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

Notifications

Announcements

No record found.

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?
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,768 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 692 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 364 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans