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 :
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
    237,980 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

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

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans