Dynamics AX Custom Workflow Creation - Locus IT Services

Dynamics AX Custom Workflow Creation

Locus IT ServicesMicrosoft Dynamics AX / AxaptaDynamics AX Custom Workflow Creation
Posted by Akshay | , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,  |

Dynamics AX Custom Workflow Creation

Dynamics AX Custom Workflow defines how a business document flows through the system and indicates who must process and approve it. The Dynamics AX Workflow functionality in Microsoft Dynamics AX helps ensure that documents are processed and approved in a consistent and efficient manner. Read on to understand the MS Dynamics AX Workflow system and see how you can configure, extend, and use it.

Below mentioned are elements integral to the AX custom workflow functionality :

  • Category
  • Query
  • Type
  • Elements

Creating AX Custom Workflow

Below is the process to create a Microsoft Dynamics AX custom workflow for a sales module where a sales order will be submitted for approval, if the credit limit for the customer related to the sales order is surpassed.

1. First of all, ensure that the batch jobs that handle the workflow execution are running.

If the batch jobs are not running, they can be started from System Administrator >> Setup>> Workflow >> Workflow infrastructure configuration.

2. Create workflow category
  • Expand Workflow Categories node in AOT >> Workflow.
  • Create New Workflow Category
  • Set namelabel, and module properties for newly created Dynamics AX Workflow category
3. Create query
  • Expand the Queries node in AOT
  • Click on New Query
  • Setup properties like Title and Description on the newly created query.
  • Expand the newly created query
  • Add main data source
  • Set dynamic property of field node of added data to Yes
4. Create workflow type
  • Expand Workflow Type node in AOT >> Workflow
  • Create New Workflow Type using workflow type wizard
  • Follow the setup wizard and set workflow type namecategory (created in the step 2), query (created in the step 3) and document menu item (display menu item of form on which the workflow will be attached)
  • On clicking next, the wizard will show a list of objects that are going to be created. A new development project with the new elements will be created
5. Create Base Enum
  • Expand the Base Enums node in AOT >> Data Dictionary
  • Create New Base Enum for workflow states
  • Set properties of the newly created enum
  • Add elements for Dynamics AX Workflow state to enum (i.e. not submitted, submitted, approved, rejected)
6. New field in table
  • Select table from the AOT >> Data Dictionary >> Tables
  • Add new enum type field and set the enum type property to enum created in previous step.
  • Compile and synchronize the table
7. canSubmitToWorkflow() method to table
  • Expand method node on a table (on which the workflow will work)
  • Add or modify the canSubmitToWorklfow() method to check whether record should be added to the workflow or not. This canSubmitToWorklfow() method contains the code which defines eligibility of record to submit it to workflow.
8. The Workflow properties on the form
  • Select Form from AOT >> Forms on workflow will be attached
9. Create workflow event handler
  • Select Event Handler Class from the AOT >> Classes to perform the action on sales order
10. Add element level event handler
  • Select Event Handler Class from the AOT >> Classes to perform the action on sales order
  • When workflow status has been updated, update the sales order enum element as well
11. Drag workflow approval to workflow type
  • Go to workflow node from the AOT. Select the workflow element from the workflow elements node and then after drag workflow element into the workflow types
12. Workflow author
  • Create new display menu items. Go to AOT >> Menu Items >> Display
13. Create and enable workflow for sales order
  • Select Display Menu Items which have previously been created and open it
  • Click on New button to select workflow from the list
  • Select the WorkFlow Type from the list and select on Create Workflow
14. Design workflow
  • Drag and drop approvals from the Workflow Elements window to the Workflow window
15. Now create a sales order and check for the workflow and it will be activated in your new sales order

Workflows are very important to any organization; by providing the functionalities to create business processes, they define how a document flows through the system by showing the steps needed to process and support along with who needs to process it. We at Locus IT provide AX Workflow implementation and support services and other Microsoft Dynamics services like Microsoft Dynamics upgradation, Microsoft Dynamics training, Microsoft Dynamics staffing as well. For more information please contact us.

Locus IT Project Management Office
What’s it?