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 :
Microsoft Dynamics AX (Archived)

Errors with Chain of Command

(0) ShareShare
ReportReport
Posted on by 144

Hi, everyone.

I would like to use a new feature: chain of commands.  I have used a trivial sample and get 2 errors after building classes or attempt to start using this class as in the image below.

Could you give me some advice? Thanks in advance.

Coc.PNG

*This post is locked for comments

I have the same question (1)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Change of commands can only be applied on protected and public methods on the base class. 

    Please refer the following links on Change of Command:

    (Video on X++ Chain Of Command)

    channel9.msdn.com/.../X-Chain-Of-Command

    (CHAIN OF COMMANDS X++ FOR DYNAMICS 365 FOR FINANCE AND OPERATIONS)

    www.dynamicon.de/.../chain-of-commands-x-von-dynamics-365-for-finance-and-operations

    (Dynamics 365 for Operations: Class extensions and Chain of Command (COC)-Next keyword)

    community.dynamics.com/.../dynamics-365-for-operations-class-extensions-and-chain-of-command-coc-next-keyword

    Hope this information helps you.

    Thanks,

    Chaitanya Golla

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    Can you also show us the definition of method1() in BaseClass1?

  • Alex Voytsekhovskiy Profile Picture
    on at

    Got the same error at Build step.

    Class Student
    {
        public real studentAge33(int arg)
        {
            return arg*10;
        }
    
    }
    
    [ExtensionOf(ClassStr(Student))]
    final class Student2_Extension
    {
        public real studentAge33 (int arg)
        {
            var s = next studentAge33(arg + 4);
        
            return s;
        }
    
    }

    Error An item with same name as method 'studentAge33' has already been defined.

    Error The next method cannot be invoked in method 'studentAge33' because it's not a Chain Of Command Method.

  • Alex Voytsekhovskiy Profile Picture
    on at

    to my solution, which successfully compiled without this extension class

  • Suggested answer
    Alex Voytsekhovskiy Profile Picture
    on at

    Supported versions

    The functionality described in this topic is available as of Platform update 9 (CoC and access to protected methods and variables).

    However, this functionality requires the class being augmented to be compiled on Platform update 9. Because the current releases of the Dynamics 365 for Finance and Operations, Enterprise editon applications have been compiled on Platform update 8 or earlier, you will need to recompile a base package (like Application Suite) on Platform update 9 or newer in order to wrap a method that is defined in that package.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans