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:
- Open the AOT.
- Expand the Menu Items node.
- Right click Display > New Menu item.
- Right click and select Properties.
- Set the Name to WorkflowConfigurationSales.
- Set the Label to Sales workflows.
- Set the Object to WorkflowTableListPage.
- Set the EnumTypeParameter to ModuleAxapta.
- Set the EnumParameter to SalesOrder.
- Right click on the menu item and select Open new window.
- Expand the Menus node in the AOT.
- Expand the SalesAndMarketing folder.
- Expand Setup.
- Select the the Menu item that you opened in the other window.
- Drag the menu item below the sales and marketing parameters.
- In the property sheet for the new node in the menu, set the property IsDisplayedInContentArea to Yes.
- Save your changes to the menu.
- 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:
- In the application workspace, select Sales and Marketing > Setup > Sales workflows.
- Click New.
- Select SalesCreditLimitApprType and click Create workflow. The workflow editor canvas window opens.
- Drag SalesCLApprovalApproval approval from the Workflow elements > Approvals window to the Workflow editor canvas.
- Drag the bottom node of the Start box to the top node of the Approval box.
- Drag the bottom node of the Approval box to the top node of the End box.
- Double click on the SalesCLApprovalApproval1 icon.
- Click Step 1.
- Right click > Properties.
- On Basic Settings enter a subject and instructions for the approval
- Click Assignment.
- On the Assignment type tab, select User
- On the User tab, double click on Sammy to select him as the user.
- Click on Close
- Optionally, define submission instructions.
- You must clear any errors if they occur for this process will not work without an active workflow.
- Click on Save and Close.
- Enter some version notes for the new workflow if you wish.
- Click OK.
- Select Activate the new version.
- Click Okay.
- 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:
- In the application workspace, navigate to Accounts receivable > Common > Customers > All customers.
- Select a customer and click Edit.
- In the Credit and collections FastTab, set a credit limit for $100.
- Close the Customers form.
- If challenged by a recalculate limit, click OK.
- Go to Sales and Marketing > Common > Sales orders > All sales orders.
- Click New sales order.
- Enter the customer account that you modified the credit limit for.
- Optionally, set the Sales origin to match the region of the company selected.
- Click OK.
- 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.
- This example displays an order with 4 LCD Monitors (Item #1000) at $450/each for Size 01 and Site 1.
- The yellow workflow Submit button and dialog displays.
- Click the Submit button and enter a comment.
- Wait for the batch job to process the workflow request. This should take one to two minutes.
- Select Actions > History. Notice that the document is waiting for approval by the person who was assigned to approve it.
- Exit Dynamics AX.
- 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.
- Open the Sales order form.
- Click the workflow Actions button and select Approve.
- Wait one to two minutes for the workflow engine to process the approval.
- 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.