dinsdag 24 maart 2009

debugging Ax workflow

Ever needed to debug parts of the workflow proces in Ax 2009?
We did yesterday.
Seems like some parts of the workflow process are ran by the workflow user (to be setup in the 'system service accounts' form under administration - security).
Which explains why breakpoints are ignored when debugging this stuff.

The guys from the Ax dev team @ MS have did foresee a handy way to bypass this obstacle.
Check out the #workflow macro, the 'WorkflowRunAsDebug' variable in it and the way the sysWorflowHandler::workflowRunAs method uses them.

By default 'WorkflowRunAsDebug' is set to 'false' which implies it uses the runas function (and the workflow execution account).
But if you set this WorkflowRunAsDebug to 'false', the code is executed using the current account (your own).

Do remember to recompile the sysWorflowHandler class (to apply changes in #workflow macro to the class)and to reset WorkflowRunAsDebug to false when releasing!

Geen opmerkingen: