“Stopped (error) X++ exception: the condition could not be evaluated” in Microsoft Dynamics AX 2012

31 10 2012

Just found a Knowledge base article that deals with the issue: “Stopped (error) X++ exception: the condition could not be evaluated” error message when you try to view workflow details in Microsoft Dynamics AX 2012

You can find the issue here: https://mbs2.microsoft.com/Knowledgebase/kbdisplay.aspx?scid=kb,EN-US,2657380

Although I haven’t experienced this issue myself I’m reposting it for anyone else who might be experiencing the problem.





Stopped (error): Failed to find workflow instance. Failed to find workflow instance.

4 05 2012

We recently recently came across an issue at a client site where workflows instances would be completed but the status would be “Stopped (error)” with error messages saying “Failed to find workflow instance. Failed to find workflow instance. Failed to find workflow instance. Failed to find workflow instance” after investigating the issue for quite a while and not finding a solution I eventually found a post at “Peng’s Dynamics AX” Blog where he listed a hotfix that Microsoft released to resolve this bug. The knowledge base article for KB2398999 and download link can be found at: http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2398999&kbln=en-us&sd=mbs#step2

Thanks to Peng for reporting this issue to Microsoft and following up with them for a year! You can view the original blog post here.





Resource Page for Known issues in AX2009 Workflow

3 05 2012

Recently came across this blog page with a list of workflow resources including hotfixes videos etc…

https://community.dynamics.com/product/ax/axtechnical/b/axresources/archive/2012/02/13/resource-page-for-workflow-in-microsoft-dynamics-ax-2009.aspx





X++ Exception: Workitem could not be created.

2 05 2012

I have been doing some tests with a new custom workflow and came across the following scenario. (Note: this describes a solution to one of the many issues that may cause this error message)

I developed a custom workflow and its setup its corresponding configuration, I was able to submit and everything but ended up getting the following error in my workflow history when the workflow system tried to assign a workitem to me:

Stopped (error): X++ Exception: Work item could not be created. 
Insufficient rights for user Jonathan.
 at SysWorkflowWorkItem-create 
SysWorkflowWorkItem-createWorkItems 
SysWorkflow-save SysWorkflowQueue-resume 
SysWorkflowMessageQueueManager-executeTask 
SysWorkflowMessageQ

After exploring for a while I found an additional line on my batch server’s event log stating “X++ Exception: The workflow system could not access the business document data. Report this issue to your system administrator.” which once can trace back to line 68 of the SysWorkflowDocument.assertAsUser method.

I reviewed the query linked to my workflow document of my custom template and realized that one of the links or ranges caused no records to be returned, ever. Fixing the query and resuming my workflow caused the workitem to process correctly.

Unfortunately this error message was a bit cryptic for the actual issue at hand, but I hope this will help someone who runs into the same issue in the future.





Workflow threw an exception for the following reason: Class MyDocumentClass cannot be instantiated.

2 05 2012

I’ve been battling trying to get one of my new AX2012 workflows to function properly. Whenever one tries to create a configuration against the template the info dialog says “An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.” Reviewing the event log gives the error “Workflow threw an exception for the following reason: Class MyWorkflowTypeDocument cannot be instantiated.

Resolving the issue required me to make use of the “Generate Full CIL” function in the AX developer workspace. Located on the toolbar to the right of the AOT button. Initially this didn’t help as some other classes or tables (still in development) didn’t compile (even unrelated to workflow). After removing these offending classes and tables and regenerating the CIL I was able to create a new workflow configuration





Workflow history error – Stopped (error): Could not find user

10 02 2012

If you have ever coded with the WorkflowParticipant provider class you may have come across the following stop error in workflow history “Stopped (error): Could not find user”. After spending a couple of hours tracing through code I eventually located the cause of the error.

In my case the participant provider class is supposed to retrieve an employeeId from a form and translate it to a userID which it  then returns in the WorkflowUserList. However in my case no user relation had been setup between the employee and the user thus the class ended up adding an empty user to the list causing the SysWorkflowProviderService::resolveDueDateAsUser  method to fail as there it couldnt find the blank user. Thus:

Resolution:
1. Always check the user id’s that you are adding to WorkflowUserList that your provider returns, to ensure that they are not empty.

E.G: Wrong:

userList.add(SysCompanyUserInfo::emplId2UserId(resp);

Right:

respUser = SysCompanyUserInfo::emplId2UserId(resp); 
if (respUser == '') { 
    throw error(strfmt("No user relationship defined for employee %1",resp)); 
} 
userList.add(respUser);




Rollup 7 Released

6 05 2011

Microsoft has release rollup 7 for Microsoft Dynamics AX 2009 service pack 1. Of course the most interesting part to me are the two workflow bugs that it resolves.

1. One can start multiple workflow instances for the same record
2. Records in the workflow history form are displayed very slowly

We’ve come across both of these issues and are really glad that official fixes have now been released.

Happy Daxing








%d bloggers like this: