Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to skip extension ...
Finance forum
Answered

How to skip extension method execution

Posted on by 6,386
Hello,
let's say we have a standard ClassA, which has run method.
Then by some partner company it was extended and some logic added in the run method, let's say xxxClassA_Extension.
So, to simplify the question, let's say we have a checkbox, if the checkbox is active the process executing normally and if not active then we need to skip extension run method and only run original standard code.
Is it somehow possible without actually modifying the xxxClassA_Extension class?
Thanks
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,277 Super User 2024 Season 2 on at
    How to skip extension method execution
    Hi Johnny,
     
    Layan is correct. You can't change the behavior of the standard coding or a partner extension. It is impossible to control which extension will run first. You can try to find a place before or after this run method in classes that calls this method. You can then check if there is an option preventing running ClassA and run a copy of the class in your own model or maybe after all calls create an extension that corrects all actions like the original code.

    If you need more guidance, then please share details about the standard code and the code created by the partner. We might then better understand the scenario and guide if something would be possible or not. Anyway, you can also try to contact the partner company if they are willing to embed the checkbox and condition in their coding.
  • Verified answer
    Layan Jwei Profile Picture
    Layan Jwei 6,882 Super User 2024 Season 2 on at
    How to skip extension method execution
    Hi vuivui,

    I think it's not possible. The "if" condition needs to be done in the extension method.

    Thanks,
    Layan Jweihan

    Please mark the answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

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,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans