Wednesday, February 8, 2017

forms

Debug X++ Code in Workflow [AX 2012]

POSTED ON  UPDATED ON 
The process to debug X++ code in Microsoft Dynamics AX workflow depends on where the code is used in the workflow. The workflow submit code is native X++, and the workflow event handler code is compiled into CIL. The following procedures describe how to enable debugging for the server, how to debug the workflow submit code, and how to debug workflow event handler code.
To enable debugging for the server
  1. Log into the server that is running the AOS.
  2. Open the Microsoft Dynamics AX Server Configuration utility with administrative privileges (Start > Administrative Tools > Microsoft Dynamics AX 2012 Server Configuration). To run the utility with administrative privileges, you must right-click its icon in the Start menu and click Run as administrator.
  3. Create a new configuration that allows for debugging.
    1. Click Manage and then click Create configuration. In the Create Configuration window, name the new configuration, such as “DAX Debugging”. Click OK.
    2. On the Application Object Server tab, select Enable breakpoints to debug code X++ code running on this server. Click Apply. If you receive a message about the AOS, indicate that it should be restarted.
  4. Click OK to close the configuration window.
To debug the submit code for workflow
  1. Open the Development Workspace.
  2. In the AOT, locate the submit code that you want to debug. Typically, this will be the main method of your submit to workflow class.
  3. Set breakpoints in the X++ code by using the Code Editor.
  4. In Microsoft Dynamics AX, perform the submit operation for workflow. The Debugger should open and stop at the breakpoints you set.
To debug workflow event handler or workflow provider code
  1. Start Visual Studio. If User Account Control (UAC) is active, make sure you start Visual Studio with administrative privileges.
  2. In the View menu, click Application Explorer.
  3. In the Classes node of Application Explorer, locate the class that contains the workflow event handler or workflow provider that you want to debug.
  4. Double-click the method that you want to debug.
  5. Insert breakpoints into the method.
  6. In the Debug menu, click Attach to Process.
  7. Click Select and mark Managed (v4.0). Click OK.
  8. In the Available Processes list, select the Ax32Serv.exe process. If you do not see the process in the list, make sure that Show processes from all users and Show processes in all sessions are marked.
  9. Click Attach. The symbols for debugging will be loaded, and the breakpoints you set should be enabled.
  10. In Microsoft Dynamics AX, perform the workflow action. When the workflow event is processed, execution should stop at the breakpoint you sets.

Hiding Query Parameters in AX 2012 SSRS Report Dialog

POSTED ON 
if we want to  hide the dynamic query parameters in a AX 2012 SSRS report dialog.
The report data source is a query, which has a  few predefined ranges. But in the report dialog, I just want to see the printer select box and not the query range fields with their predefined values. I set the status of the query ranges to hide, but it had no effect on the dialog.
In this case we  go like this..
If you use a report controller class, you can overwrite the showQuerySelectButton() method and return false.

No comments:

Post a Comment