End of mainstream support for Microsoft Dynamics AX 2009, 2012, and 2012Mainstream support for Dynamics AX 2009 Service Pack 1 (SP1), Dynamics AX 2012, and Dynamics AX 2012 R2 ended Oct. 9, 2018. After that date, only security hotfixes will be provided for these three versions through the extended support period that until Oct. 12, 2021. Read more
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
I've got a custom workflow which I have setup to be used with work item queues (i.e. I simply put [WorkflowDocIsQueueEnabledAttribute(true, "Quality Orders")] before the workflow document class. This allows the workflow to run fine however when I go to home/Work Items/ Work items assigned to my queues I don't see the workflows associated with the Quality order queues.
I think the answer has something to do with the WorkflowQueueCreatedEventHandler which should be creating records in the WorkflowQueueDocumentCommonFields table (this table is joined to when viewing the 'Work items assigned to my queues' page).
I've tried replicating the class PurchTableTaskCreatedEventHandler which extends WorkflowQueueCreatedEventHandler but this doesn't seem to work. When putting purchase orders into a queue I can catch breakpoints in this code but not when I do the same thing for my custom quality order workflow.
My knowledge on event handling is not that good. I'm not sure exactly how the system knows to trigger my particular class Can anyone tell me what else I'd need to do to trigger this event handler and run my custom class (essentially a duplicate of PurchTableTaskCreatedEventHandler) to populate the WorkflowQueueDocumentCommonFields?
Alternatively, I may be on completely the wrong track here and someone can point me in the right direction as to how to get my items to appear in 'Work items assigned to my queues'
Managed to work this out today. So the process for getting a custom workflow to cooperate with work items queues is:
1) First problem. The Quality Order document is not available for selection in the work item queue. See below.
To fix this we simply need an attribute on the workflow document class. i.e
[WorkflowDocIsQueueEnabledAttribute(true, "Quality Orders")]
class InventQualityOrderWorkflowDocument extends WorkflowDocument
Now we can create a work item queue based on this document.
2) As described in my original question I was not able to see my waiting work items.
1) After looking at the datasources on this form for quite some time I tracked it down to being a problem with the WorkflowQueueDocumentCommonFields table not getting populated. The population of this table occurs when the class WorkflowQueueCreatedEventHandler is triggered by the Work Items Created Event being setoff in the workflow.
The answer to this was to create the following class:
class InventQualityOrdeTaskCreatedEventHandler extends WorkflowQueueCreatedEventHandler
protected void mapFields()
dictClass = new DictClass(classNum(PurchTableDocument));
attribute = dictClass.getAttribute(#WorkflowDocumentAttribute);
inventQualityOrderTable = InventQualityOrderTable::findRecId(this.parmWorkflowWorkitemTable().RefRecId);
NB: This was based on classes\PurchTableTaskCreatedEventHandler.
This class extends WorkflowQueueCreatedEventHandler which in turn implements WorkflowWorkItemsCreatedEventHandler.
In order to trigger this event you must point the workflow tasks to the above class.
Find the task under AOT/Workflow/Tasks. Look for the property WorkItemsCreatedEventHandler. Put the name of your event handler in here. (in my case InventQualityOrdeTaskCreatedEventHandler).
Now this gets triggered when the work item is created, the WorkflowQueueDocumentCommonFields will be populated and the work items will show in home/Work Items/ Work items assigned to my queues
Hope this helps someone else in the future.
Thank you for this post David - it has taken a lot of guess work out of why the work items aren't being shown for our custom workflow.
Business Applications communities