Configuring Workflow for Microsoft Dynamics AX 2012

By - April 30, 2014

Introduction

In the first article Simplifying Workflow, we reviewed the steps for running the workflow infrastructure configuration wizard, creating a workflow category, defining a query for the workflow, and creating a workflow type. In the second article Designing Workflow, we covered enabling the workflow on a form, creating a workflow class, an approval, and event handlers. These are the fundamentals that are required to get started with a new workflow.

This article is a continuation of the process for configuring a new workflow based on the objects created in the first and second articles. As a part of configuring the workflow, we will review the steps for creating a menu item, implementing a workflow on the canvas, and testing the workflow once complete.

Scenario

The Contoso database uses Fabrikam as an example of an audio product manufacturing company that needs to configure and setup a new Sales order workflow project. The sales team wants to implement a process for approving sales orders for customers that will exceed their credit limit, however, there is no current sales order workflow infrastructure to build this upon. Following are the operations that must be completed to configure the workflow.

Adding the Workflow to a Menu

Perform the following steps to configure a menu item for the workflow created in earlier steps:

  1. Open the AOT.
  2. Expand the Menu Items node.
  3. Right click Display > New Menu item.
  4. Right click and select Properties.
  5. Set the Name to WorkflowConfigurationSales.
  6. Set the Label to Sales workflows.
  7. Set the Object to WorkflowTableListPage.
  8. Set the EnumTypeParameter to ModuleAxapta.
  9. Set the EnumParameter to SalesOrder.
  10. Right click on the menu item and select Open new window.
  11. Expand the Menus node in the AOT.
  12. Expand the SalesAndMarketing folder.
  13. Expand Setup.
  14. Select the the Menu item that you opened in the other window.
  15. Drag the menu item below the sales and marketing parameters.
  16. In the property sheet for the new node in the menu, set the property IsDisplayedInContentArea to Yes.
  17. Save your changes to the menu.
  18. Menu item changes only take effect after AX has been exited. Exit Dynamics AX and log back to see the changes.

Implementing a Workflow

Perform the following steps to configure a workflow on the workflow editor canvas:

  1. In the application workspace, select Sales and Marketing > Setup > Sales workflows.
  2. Click New.
  3. Select SalesCreditLimitApprType and click Create workflow. The workflow editor canvas window opens.
  4. Drag SalesCLApprovalApproval approval from the Workflow elements > Approvals window to the Workflow editor canvas.
  5. Configuring-Workflow-1
  6. Drag the bottom node of the Start box to the top node of the Approval box.
  7. Drag the bottom node of the Approval box to the top node of the End box.
  8. Configuring-Workflow-2
  9. Double click on the SalesCLApprovalApproval1 icon.
  10. Click Step 1.
  11. Right click > Properties.
  12. On Basic Settings enter a subject and instructions for the approval
  13. Click Assignment.
  14. On the Assignment type tab, select User
  15. On the User tab, double click on Sammy to select him as the user.
  16. Click on Close
  17. Optionally, define submission instructions.
  18. You must clear any errors if they occur for this process will not work without an active workflow.
  19. Click on Save and Close.
  20. Enter some version notes for the new workflow if you wish.
  21. Click OK.
  22. Select Activate the new version.
  23. Configuring-Workflow-3
  24. Click Okay.
  25. Configuring-Workflow-4
  26. Ensure that the workflow is set to default. If not, click the Set as Default button in the Manage group of the Action pane.

Testing the Workflow

Perform the following steps to test the workflow by setting a credit limit and creating a sales order:

    1. In the application workspace, navigate to Accounts receivable > Common > Customers > All customers.
    2. Select a customer and click Edit.
    3. In the Credit and collections FastTab, set a credit limit for $100.
    4. Close the Customers form.
    5. If challenged by a recalculate limit, click OK.
    6. Go to Sales and Marketing > Common > Sales orders > All sales orders.
    7. Click New sales order.
    8. Enter the customer account that you modified the credit limit for.
    9. Optionally, set the Sales origin to match the region of the company selected.
    10. Click OK.
    11. Enter items and quantities in the sales lines so that the balance of the customer plus the total amount on the lines is greater than the credit limit.
    12. This example displays an order with 4 LCD Monitors (Item #1000) at $450/each for Size 01 and Site 1.
    13. Configuring-Workflow-5
    14. The yellow workflow Submit button and dialog displays.
    15. Click the Submit button and enter a comment.
    16. Wait for the batch job to process the workflow request. This should take one to two minutes.
    17. Select Actions > History. Notice that the document is waiting for approval by the person who was assigned to approve it.
    18. Exit Dynamics AX.
    19. Select one of the following two options to login as Sammy:

o Login to windows as the Sammy using the Switch User option on the Start menu.

o Right click on Microsoft Dynamics AX client and hold the shift key and Right click the launch icon to login as Sammy.

  1. Open the Sales order form.
  2. Click the workflow Actions button and select Approve.
  3. Wait one to two minutes for the workflow engine to process the approval.
  4. The workflow is approved.

Conclusion

This article reviews the configuration of a workflow project. Specifically, it covers configuring workflow by creating a menu item and placing on the menu, implementation in the canvas, and testing the workflow once complete. This is the final article of a three part series that dealt with the setup, design, and configuration of a workflow.

 

Comments

Comments are closed here.

Receive Posts by Email

Subscribe to the Microsoft Dynamics categories and receive notifications of new posts by email.
  • This field is for validation purposes and should be left unchanged.