Workflow Identifying Fields: To Add a Workflow for a Value of the Workflow-Identifying Field

The following activity will walk you through the process of defining a workflow for a specific value of the workflow-identifying field.

Story

Suppose that you have a repair work order can be performed in the following ways:

  • Quickly while the customer awaits in the phone repair shop. In this case, the workflow can skip most of the traditional statuses and be paid right after it is created. So the workflow can have only three statuses (On Hold, Completed, Paid) and direct transitions from one to another.
  • In a few days while the order awaits the assigned employee. In this case, the standard default workflow can be applied.
  • In a few weeks because some of the required items are out of stock. In this case, the workflow might have an additional status, Awaiting Delivery, in addition to standard statuses of the workflow described in Company Story and Customization Description.

These ways of performing a repair work order are defined by the Order Type box which can have one of the following values:

  • Simple
  • Standard
  • AwaitingDelivery

In this activity, you will define a workflow for the Simple value of the Order Type box which is shown in the following diagram.

Figure 1. Workflow for the simple order type


The workflow has three statuses: On Hold, Completed, and Paid. When the repair work order is created, it gets the On Hold status. Then a user can click the Complete action on the form toolbar, which changes the order to Completed. After that, a user can click Create Invoice on the form toolbar which initiates creation of an invoice for this repair work order. When the invoice is created, a user can release and pay it on the Invoices (SO303000) and Payments and Applications (AR302000) forms respectively. As soon as the invoice is fully paid, the repair work order status should be changed to Paid.

Process Overview

In this activity, you will first add the UsrOrderType field which will hold the order type to the Repair Work Orders form. Then, in the screen configuration for the Repair Work Orders form, you will specify this field as a workflow-identifying field. Then, you will add a workflow for the Simple value of the UsrOrderType field.

Note: Creation of workflow for other values of the UsrOrderType field is not covered by this activity.

You do not need to define any new actions, events, or event handlers because you will be reusing those defined in the original graph and the workflow for the Repair Work Orders (RS301000) form: You will use the CreateInvoice action defined in Workflow Actions: To Configure the Conditional Appearance of the Action, and the Complete action defined in Workflow Actions: To Implement an Action with Field Assignments. You will also use the OnCloseDocument event handler which is called when the invoice is fully paid. This event handler is defined in Workflow Events: To Use an Existing Event.

For training purposes, you will add the custom field and modify the workflow code in separate extensions.

System Preparation

In an instance with the T100 dataset, make sure that you have done the following: