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)

How to debug a listpage on enterprise portal AX 2012?

(0) ShareShare
ReportReport
Posted on by 2,550

Hi All,

I want to debug a piece of code that is called from a listpage running on the enterprise portal (AX 2012).

What do I have:
- a listpage containing a button in the actionpane
- a class that is called by clicking the button

What did I try already:
- Debug the class using the AX 2012 debugger.
  Result: breakpoints are never hit. Other breakpoints, for example one on the init of a dataset of a webcontrol, do get hit, so the           debugger is working and hitting global/bc breakpoints.
- Debug the class in Visual Studio 2010 with the debugger attached to the AxServ process.
  Result: breakpoints are never hit.
- Debug the class in Visual Studio 2010 with the debugger attached to the w3wp process.
  Result: breakpoint stays disabled.

Is there anyone who can please help with this??
What did I miss? Is there any documentation about debugging EP listpages?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    The class should still be executed in the X++ runtime unless it is explicitly run in IL, which you would know if that was the case. So that implies you should debug using the AX 2012 debugger (I'm assuming you're talking about an X++ class and not a C# class in your web app project).

    The fact that you can hit dataset methods means indeed you have everything setup correctly, but I've included the MSDN links below anyway, just in case. One thing I've found mentioned in a few places is that you should consider explicitly stating "breakpoint" in the code (the X++ keyword). I find this hard to believe this would be necessary, but I've seen it in several documents from Microsoft so it may be worth the try, regardless of how ugly it is.

    msdn.microsoft.com/.../aa629010.aspx

    msdn.microsoft.com/.../cc567649.aspx

  • Xander Vink Profile Picture
    2,550 on at

    Hi Joris,

    thank you for your suggestions, but I've already tried all that (even with the breakpoint statement in code). I think the listpages run in CIL, but I don't know under which process. I know it's not the ax32serv or the w3wp, as I tried both.

    If you have any more idea's please let me know.

    Thanks.

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    I have access to some Microsoft EP resources so I will ask this question and see if I can get it answered.

    Meanwhile, if you suspect it's running in CIL, that will always run server-side, so you'd have to debug ax32serv.

  • Xander Vink Profile Picture
    2,550 on at

    Also very annoying:

    websession() always returns null in the listpageinteraction class. There is no way, or at least not that I know of, to check if the listpage is run from the web or client.

  • Xander Vink Profile Picture
    2,550 on at

    I think I got some more info about listpages running at the EP in the form of an error message:

    [code]
    Executing the action menu item 'MyMenuItem' is not supported.
    Verify that the RunOn property is set to either Called From or Server.
    at Microsoft.Dynamics.AX.Framework.Services.InteractionService.InteractionService.ExecuteActionMenuItem(ActionMenuItemExecutionArguments actionMenuItemExecutionArguments)
    at SyncInvokeExecuteActionMenuItem(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)).
    --- End of inner exception stack trace ---
    at Microsoft.Dynamics.AX.Framework.Services.Client.ServiceClientHelper.InvokeChannelOperation[TChannel](IServiceClient`1 client, Action`1 operationInvoker, Func`2 exceptionWrapper)
    at Microsoft.Dynamics.AX.Framework.Services.Client.InteractionService.InteractionServiceClientInternal.ExecuteActionMenuItem(ActionMenuItemExecutionArguments actionMenuItemExecutionArguments)
    at Microsoft.Dynamics.AX.Framework.Services.Client.InteractionService.InteractionServiceClient.ExecuteActionMenuItem(ActionMenuItemExecutionArguments actionMenuItemExecutionArguments)
    at Microsoft.Dynamics.Framework.Portal.UI.WebControls.ModeledActionPaneCommandHandler.HandleActionMenuItemClick(IMenuItemMetadata menuItemMetadata, String dataSourceName, String parameters, IAxTableRowKey externalRowKey, Boolean needsRecord)
    at Microsoft.Dynamics.Framework.Portal.UI.WebControls.ModeledActionPaneCommandHandler.HandleButtonClick(IButtonControlMetadata buttonControlMetadata, IAxTableRowKey externalRowKey)
    at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxListPageContentArea.HandleButtonClick(IButtonControlMetadata buttonControlMetadata, IAxTableRowKey externalRowKey)
    Please check the event log or contact your administrator.
    [/code]

    It looks to me that the listpage is executed using some kind of (web?)service?

    Question still remains: how do I debug this?

  • Suggested answer
    Joris dG Profile Picture
    17,775 on at

    How are you debugging this? I'm pretty sure after more thinking that the pages do not run in IL, so you should use the AX debugger. But, I found a note that says that debugger should always be run in the CONSOLE session on the web server. If you don't have physical access to the web server, use "mstsc /console" to start the remote desktop client. This will make your session run as the console session.

  • Xander Vink Profile Picture
    2,550 on at

    I started mstsc with /admin (=/console) and I am able to debug other code that is called from the enterprise portal (such as methods on datasets), but debugging a class that is called using an action menuitem from a listpage doesn't work. Using the infolog I did get the following information:

    Is clr session: false  
    Is running on server: true
    XPP Stack: (S)\Classes\MyClass\main 10 (S)\Classes\xMenuFunction\run 0
    Systemsessionid: 1
    Is workerthread: true
    MasterSessionId: 0

    Running the same menuitem from a different (non listpage) page (where the breakpoint is hit):

    Is clr session: false
    Is running on server: false
    XPP Stack: (C)\Classes\MyClass\main 10 (C)\Classes\WebActionMenuFunction\run 0
    Systemsessionid: 1
    Is workerthread: false
    MasterSessionId: 16

    So could it be that the breakpoint is not hit because the code runs in a workerthread?
    And if so, how would one debug this?

  • Sudheer Profile Picture
    10 on at

    The AX 2012 debugger must be opened as admin while trying to debug AX code from EP. And make sure that global breakpoints are enabled and AOD is refreshed from "Role center" page before trying to debug.

    If the class is running on IL, then it needs to be debugged using VS 2010 by attaching AX32 process.

    AX2012 provides a framework where a common list page will be share by both rich and enterprise portal. All the related code logic must be implemented in the interaction class created for each list page created using list page template.

  • Xander Vink Profile Picture
    2,550 on at

    Tried all the regular ways to debug this, but I just can't get it to work.

    A normal webpart or AX code is no problem, but debugging a class that is called using an action menuitem from a listpage just doesn't seem possible as it is running is a separate worker thread (see earlier posting).

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