Create a Base Enumeration to Track the Approval Status
The state of any of the workflows will be tracked through an enumeration field, which allows you to assign any number of values to segregate out the different processes.
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 create a new Base Enum field type to track the workflow statuses, follow these steps:
- From within the workflow development project, right-mouse-click on the parent folder, and from the New menu, select Data Dictionary and then Base Enum to create a new enumeration field for the statuses.
- Change the Name of the enumeration to ProductApprStatus and change the Label to be Product Approval Status.
- Now we need to define the valid values for the enumeration. To create a new element, right-click on the ProductApprStatus enumeration, and select the New Element option.
- This will create a new element for you that you can change the Name to NotSubmitted and the Label to Not Submitted.
- Repeat to create elements for Submitted, Approved, and Rejected.
- After you have done that, save the project and make sure that there are not any errors in your update.