Archive

Workflow

Now that we have created our workflow, we can actually create a simple approval workflow through the workflow designer.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

In the past, creating a workflow was made challenging because there was a lot of plumbing that was required in order to create the workflow type, and if you didn’t have it all just right then you spent forever trying to track down the problems. With the introduction of Dynamics AX 2012 though a wizard was added to the AOT tools that does almost all of the work for you so that you don’t have to be an experienced developer in order to create workflow templates.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

Before we move on to the next step and create the workflow template, there is one final step, and that is to create a query onto the base table, in this case InventTable, that we will be able to mark as dynamics and then use within the Workflow Wizard.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

Tables need to be enabled for workflow processing before they can be used by the workflows themselves. This is done simply by adding a method to the table called canSubmitToWorkflow.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

Now that we have the status field on the table that we are going to trigger the workflow from, we can add it to the Released Products form so that we will be able to see the statuses of all of the product approvals. The easiest way to do this is by personalizing the form.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

Now that we have a Base Enumeration that defines all of the possible states for the approval of the products, we need to add it to the Product table so that we can track the status of the records.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

Now that the workflow has been associated with the form, you can submit the product to the workflow process, and also perform approval steps.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

How to do it…

To submit and act upon the workflows through the Dynamics AX forms, follow these steps:

  1. The first thing that you will notice now that the workflow has been associated with the form is that there will be a workflow header at the top of the form. This allows you to see the workflow that is associated with the form, and also submit the record to the workflow.
  2. If you click on the icon just to the left of the Submit button, Dynamics AX will show you the submission instructions that you have defined for the workflow.
  3. To submit the product to the approval workflow process, all you need to do is click on the Submit button.
  4. This will open up a comment dialog box. If you want, you can enter any comments into the Comment field, and then click the Submit button.
  5. The Submit button will change now to reflect the options for the current workflow step. In this case we will see the Approved and Rejected options for out manual decision, and also the standard Delegate and Cancel workflow actions.
  6. If you click on the View History action, you will be able to see the current status of the workflow, and also all of the steps that have been performed up until this point on the workflow.
  7. If you click on the Approved action, the workflow processor will open up a comment dialog box. If you want, you can enter any comments into the Comment field, and then click the Approved button.
  8. Now that the approval process is complete, the Actions button will only show the View history option.
  9. If you click on the View History action, you will be able to see that the status of the workflow is completed and also see when it was completed.

Before we start workflows running, we need to make sure that workflow processor is up and running so that it is able to move workflows from stage to stage. If you are running in a development environment, a simple way to do this is to use the tutorial_workflowprocessor which you can find hidden away in AOT. This allows you to start and stop the workflow processor on demand.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

How to do it…

To access and start the tutorial version of the Workflow Processor, follow these steps:

  1. Open up the AOT explorer and expand the Forms node. Find the Tutorial_WorkflowProcessor form, right-mouse-click on it and select the Open menu item.
  2. When the workflow processor dialog box is displayed, click the Start button.

How it Works…

Now as long as you have the processor running, it will automatically process any workflow steps that are in the queue.

The final update that we need to do on our workflow type is to add some code top the Approval Handler to tell the workflow what to do when the workflow completes.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More

The default labels that are generated by the Workflow Wizard for the submission menu items are a little generic, so it is a good idea to just fix the labels so that they look more appealing to the user.

NOTE: This is part of the Developing a Product Approval Workflow in Dynamics AX 2012 blog series where we show how to develop a completely new workflow to manage the new product approval process. If you want to see all of the other posts in this series, click here.

Read More