Workflow-Identifying Fields of the Second Level: Process Activity
The following activity will walk you through the process of creating workflows for custom order types.
Story
Suppose that you want to give users the ability to create sales orders of the In-Store Retail Order and Phone Order types, and you do not want users to put the orders of the In-Store Retail Order type on hold. Further suppose that the orders of the Phone Order type should be confirmed. This means that when a user creates a phone order, its status should change to Pending Confirmation, and that the user should confirm the order to open it. You need to create separate workflows for these order types.
Process Overview
By using the Order Types (SO201000) form, you will create two order types. By using the Workflows page of the Customization Project Editor, you will create separate workflows for these order types. On the Sales Orders (SO301000) form, you will then test the customized workflow.
System Preparation
Before you begin performing the steps of this activity, do the following:
- Launch the MYOB Acumatica website with the U100 dataset preloaded, and sign in as system
administrator by using the gibbs username and the 123
password.Tip: The gibbs user is assigned the Administrator role, which has sufficient access rights to customize workflows.
- Make sure you have learned how to perform workflow customization, as described in Inherited Workflows: General Information.
- On the Customization Projects (SM204505) form, create a customization project named SalesOrderTypes.
Step 1: Creating Order Types
To add new order types, do the following:
- In MYOB Acumatica, open the Order Types (SO201000) form, and add a new record.
- In the Summary area, specify the following settings:
- Order Type: IS
- Description: In-Store Retail Order
- Order Template: SO
- On the General tab, specify the following settings:
- Order Numbering Sequence (Order Settings section): SOORDER
- Calculate Freight (Order Settings section): Cleared
- Freight Account (Posting Settings section): 40010 (Sales – Freight)
- On the form toolbar, click Save.
- On the form toolbar, click Add New Record, and specify
the following settings in the Summary area:
- Order Type: PH
- Description: Phone Order
- Order Template: SO
- On the General tab, specify the following settings:
- Order Numbering Sequence (Order Settings section): SOORDER
- Calculate Freight (Order Settings section): Cleared
- Freight Account (Posting Settings section): 40010 (Sales – Freight)
- On the form toolbar, click Save.
Step 2: Creating the Workflow for the In-Store Retail Order Type
To create a workflow for the In-Store Retail Order type, which you have added in the previous step, do the following:
- Open the SalesOrderTypes customization project, and add the Sales Orders (SO301000) form to the list of customized screens. (For details, see Workflow Creation: To Add a Workflow.)
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) Workflows page of the Customization Project Editor opens. Notice that the table on the page contains multiple workflows. Also notice that the value in the Subtype Identifier box is Order Type and that this box is read-only.
. - On the More menu (under Actions), click Add Workflow.
- In the Add Workflow dialog box, which opens, specify the
following settings:
- Operation: Extend System
Workflow
You select this operation when you want to create an inherited workflow based on another workflow.
- Base Workflow: SO Workflow
This is the specific workflow that will be extended for the inherited workflow that you are creating.
- Workflow Type: SO
This setting indicates that the created workflow will be used for sales orders that have the have the Sales Order automation behavior.
- Workflow Subtype: IS
This setting indicates that the workflow will be applied to the sales orders of the In-Store Retail Order order type.
- Workflow Name: Sales Order: IS (inserted automatically)
- Operation: Extend System
Workflow
- Click OK to close the dialog box.
A row for the workflow appears in the table on the Workflows page. Notice that the workflow’s status is Inherited. Also notice that the value in the Base System Workflow column is SO Workflow.
- Select the Active check box in the row with the created
workflow.
Notice that the Active check box is still selected for the predefined workflow (SO Workflow). The system will use the Sales Order: IS workflow for sales orders of the In-Store Retail Order type. Also, the system will use the predefined SO Workflow for sales orders of the Sales Order, eCommerce Order, and Sales Order with Allocation types.
- On the page toolbar, click Save.
Step 3: Creating the Workflow for the Phone Order Type
To create a workflow for the Phone Order type, which you have added in Step 1, do the following:
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) Workflows page of the Customization Project Editor opens. Notice that the Subtype Identifier box is unavailable for editing and that the value in this box is Order Type.
. - On the More menu (under Actions), click Add Workflow.
- In the Add Workflow dialog box, which opens, specify the
following settings:
- Operation: Extend System Workflow
- Base Workflow: SO Workflow
- Workflow Type: SO
- Workflow Subtype: PH
This setting indicates that the workflow will be used for sales orders of the Phone Order order type.
- Workflow Name: Sales Order: PH (inserted automatically)
- Click OK to close the dialog box.
A row for the workflow appears in the table on the Workflows page. Notice that the workflow’s status is Inherited.
- Select the Active check box for the created
workflow.
Notice that the Active check box is still selected for the predefined workflow (SO Workflow) and for the Sales Order: IS workflow you have created in the previous step. This means that when you create a sales order of the Phone Order type, the system will use this new workflow and not the SO Workflow or Sales Order: IS workflow.
- On the page toolbar, click Save.
Step 4: Specifying Settings for the Sales Order: IS Workflow
Now that you have created the workflows for each of the new order types, you can specify different settings for these workflows. Do the following:
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) State Diagram: Sales Order: IS page opens.
. - In the States and Transitions pane, click the Open state.
- On the Actions tab, clear the check box in the row with
the Hold (putOnHold) action.
This setting indicates that this action will not be available when the order is in the Open state.
- In the Transitions node of the Open state, click the transition the On Hold state.
- On the Transitions tab, clear the
Active check box for the transition.
This setting indicates that the user will not be able to change the status of the order from Open to Hold.
- Save your changes.
- Publish the customization project.
Step 5: Specifying Settings for the Sales Order: PH Workflow
Specify the settings for the Sales Order: PH workflow as follows:
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) State Diagram: Sales Order: PH page opens.
. - On the page toolbar, click Add State, and specify the
following settings in the dialog box that opens:
- Identifier: W
- Description: Pending Confirmation
- Click OK to close the dialog box, and save your changes.
- On the States and Transitions pane, click the Pending Confirmation state, and on the page toolbar, click Add Transition.
- In the Add Transition dialog box, which is opened, click
Create to the right of the Trigger
Name box, and specify the following settings in the dialog box
that opens:
- Action Name: Confirm
- Display Name: Confirm
- Click OK to close the dialog box.
- In the Add Transition dialog box, to which you return,
select Open in the Target State box, and click
OK.
The system adds the transition to the Pending Confirmation state.
- On the States and Transitions pane, click the Pending Confirmation state again, and on the page toolbar, click Add Transition.
- In the Add Transition dialog box, which is opened,
specify the following settings:
- Trigger Name: Cancel Order (cancelOrder)
- Target State: Cancel
- Click OK to close the dialog box, and save your changes.
- On the States and Transitions pane, expand the Transitions node for the _ initial state, and click the transition to the Open state.
- On the Transition Properties tab, select Pending Confirmation in the Target State box, and save your changes.
- Publish the customization project.
Step 6: Testing the Customization
In MYOB Acumatica, test your changes as follows:
- Open the Sales Orders (SO30100) form. If you already have the form open, refresh it.
- Create a sales order, and specify the following settings in the Summary area:
- Order Type: IS
- Customer: CANDYY
- Description: Jam order
- On the Details tab, click Add Row,
and specify the following settings in the row:
- Inventory ID: CHERJAM32
- Quantity: 5
- Save your changes.
Notice that the status of the sales order is Open, and that Hold command is not available on the More menu.
- Add a new sales order, and specify the following settings in the Summary
area:
- Order Type: PH
- Customer: COFFEESHOP
- Description: Fruit order
- On the Details tab, click Add Row,
and specify the following settings in the row:
- Inventory ID: GRAPEFRUIT
- Quantity: 5
- Save your changes.
Notice that the status of the sales order is Pending Confirmation, and that on the More menu, only the Confirm and Cancel Order commands are available.
- On the More menu (under Actions), click
Confirm.
The status of the sales order changes to Open.