Thursday, January 21, 2016

Breakpoint ax 2012

//If Breakpoint is not worked
For your specific issue, you need to do that in class 'SysOperationRPCFrameworkService' to change the method 'runServiceOperation' to,
public static container runServiceOperation(ClassId controllerClassId, container packedController)
{
    return SysOperationServiceController::runServiceOperation([controllerClassId, packedController]);
}

One of the neat features of Dynamics AX 2012 is that it provides a way to compile X++ code to IL which then can be consumed by Microsoft .NET framework and  in return enhances the performance. But this brings some complexity to the issue identification and debugging efforts. In Dynamics AX 2012 client, if you receive an Infolog message which is not very meaningful and the double click on that message does not take you to any code, it is very likely that the code that you are running during your process is compiled into IL using this new feature. One way to get around this issue and to debug the System Operations Framework is to make the following change on runServiceOperation function of SysOperationRPCFrameworkService  class:

public static container runServiceOperation(ClassId controllerClassId, container packedController)
{
    // Use the runas API to transition to a CLR session
    new XppILExecutePermission().assert();
   
    // Disable this piece of Code - AK
    /*return SysDictClass::invokeStaticMethodIL(classStr(SysOperationServiceController),
                                        staticMethodStr(SysOperationServiceController, runServiceOperation),
                                        [controllerClassId, packedController]);*/
 
    // instead make this call - AK
    return SysOperationServiceController::runServiceOperation([controllerClassId, packedController]);
}
 After making this change, you will be able to double click the Infolog message and put a breakpoint and trace the call stack to find the underlying issue that causes the Infolog message.

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...