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)

Chain Of Command In D365 Ax7

(0) ShareShare
ReportReport
Posted on by

Hi friends,

           I am facing an issue in chain of commands, i am trying to take extension for private method but i shows the error.Shown Below,

4405.Untitled.png

I tried to take custtable form extension here, for the method "disableEnableControlsForItemTracing".

But it shows like "The method 'disableEnableControlsForItemTracing' can not be used as chain of command method because its target method is not protected or public 

in class 'disableEnableControlsForItemTracing'".Please Suggest an solution.

Thanks & regards,

padmapriya

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,451 Most Valuable Professional on at

    As the error message clear says, you can use this for protected and public methods only, not for private ones.

    This is by design; there is no problem in AX.

  • Community Member Profile Picture
    on at

    Hi Martin,

                Than how can i take extension for private methods in chain of command in D365.

    Thanks & regards,

    padma priya

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

    You can't; it's not supported. Private methods can be used only from the class where they're defined.

    One option is finding a different way to implement your requirement. If you don't know how and you need our help, please explain what behavior you're trying to achieve.

    If it's not possible, you must contact the owner of the code (Microsoft in this case) and ask them to add an extension point.

  • Community Member Profile Picture
    on at

    Hi Martin,

               I need to take extension In the form Custtable and the method name is "disableEnableControlsForItemTracing".

    Thanks & regards,

    padmapriya

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

    Then you've already failed, because it's impossible.

    I meant that you should look at the business requirement and find a different technical solution then trying to extend a private method. And we can't help you if you keep talking about the wrong code instead of what functional behavior you're trying to achieve.

  • Suggested answer
    Satish kakileti Profile Picture
    185 on at

    Hi Padma,

    As per my understanding, method disableEnableControlsForItemTracing contains code to disable or enable field controls when CustTable form is called from InventTrackingDimTracing form.

    Hope this helps,

    'disableEnableControlsForItemTracing ' is being called from Init method and based on condition when tracefilter exists. So copy post event handler of Init method and proceed as follows,

    /// <summary>

       ///

       /// </summary>

       /// <param name="args"></param>

       [PostHandlerFor(formStr(CustTable), formMethodStr(CustTable, init))]

       public static void CustTable_Post_init(XppPrePostArgs args)

       {

           InventTrackingCustomerSummaryFilter traceFilter;

           FormRun                             formrun      = args.getThis();

           formDataSource                      CustTable_DS = formrun.dataSource(tableNum(CustTable));

           traceFilter = formrun.args().parmObject() as InventTrackingCustomerSummaryFilter;

           if (traceFilter)

           {

               CustTable_DS.object(fieldNum(CustTable, Currency)).visible(false);

               CustTable_DS.object(fieldNum(CustTable, CustClassificationId)).visible(true);

           }

       }

    Thanks & regards,

    Satish Kakileti.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans