Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to skip extension method execution

(1) ShareShare
ReportReport
Posted on by 6,420
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... 291,642 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 7,264 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

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans