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, ...
Active Discussion

Block standard Code execution in COC

(0) ShareShare
ReportReport
Posted on by 505

Hi Experts,

Just out of curiousity, Will this be a right way of stopping the execution of standard method in COC? It gives no compilation error and works well.

class StandardClass

{

          date standardMethod()

         {

        //some logic

        ret date;

          }

}

[Extensionof(classstr(StandardClass))]

final class StandardClass_Extension

{

       date standardMethod()

      {

                TransDate                dateTest;

                void skipOriginal()

                {

                  dateTest =  next standardMethod()

                }

               //Never call skipOriginal method

               ///Now write your custom code or copy paste standard method with your customzation.

       }

}

  • nmaenpaa Profile Picture
    101,174 Moderator on at

    No, you are not supposed to do that. I also noticed that someone found this bug, and MS will fix it.

    So, please don't try to stop the standard code from being executed. It's not supported, and it's not an extensible change by nature.

  • WillWU Profile Picture
    22,363 on at

    Hi Ishu,

    You can't skip standard method by COC.

    In your codes, you have changed a piece of code inside the method standardMethod(), this is not extension.

    You may have to rethink your technical solution, or you could ask Microsoft to change the code.

  • Sergei Minozhenko Profile Picture
    23,099 on at

    Hi,

    If the original method is wrapped by Replaceable attribute you can skip next call.

    docs.microsoft.com/.../extensibility-attributes

    Could you, please, provide more information on why you want to skip standard code? There are different ways how you can avoid using standard code (like code inheritance, or sometimes method can be wrapped by condition method which can return false in extension), but you should clearly understand the impact.

  • Joris dG Profile Picture
    17,782 on at

    As mentioned here, that trick with a function is a bug and will be fixed soon.

    If you have a need for this code to be skipped, you should file an extensibility request through LCS, explaining your scenario. This will help the owning team to determine how to best enable your scenario.

    If you ask to skip the method, they will reject your request. Please explain WHY and what you're trying to do. There may be better ways to can enable what you need.

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... 239 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 221

#3
Subra Profile Picture

Subra 166 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans