Workflow-Identifying Fields: To Automate Transitions by Using Conditions (in the Diagram View)
The following activity will walk you through the process of adding to the workflow new transitions that are performed automatically when conditions are met. You will use the Workflow (Diagram View) page to perform this activity.
Story
In the predefined sales order workflow, when a user clicks
Hold on the form toolbar or More menu of the Sales Orders (SO301000) form, the Hold
(putOnHold)
action triggers transitions to the On Hold
state from any of the following states:
Credit Hold
- P
ending Processing
Awaiting Payment
Open
Back Order
On Hold
state from each of these states.
With the changes implemented, a sales order will be put on hold automatically from
any of these states if its Order Total on the Sales Orders (SO301000) form is greater than or equal
to $800 and it has not been removed from hold manually.putOnHold
action instead of a
custom one. However, you cannot adjust a system action to be run automatically
by a condition, because system actions cannot be automated in this way.
Therefore, you cannot use the system action in this scenario.Process Overview
By using the Workflow (Diagram View) page, you will
create a transition from the Open
state to the On
Hold
state. To do so, on the same page, you will create a new action
that triggers this transition, and specify the conditions for it. You then will add
transitions to the On Hold
state from other states.
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 that you have learned how to add actions and transitions, as described in Action Configuration: General Information and Conditions and Transitions: General Information.
- Make sure that you have completed the Workflow-Identifying Fields: To Add Conditions with User-Defined Fields activity.
Step 1: Adding a New Transition Between the Open State and the On Hold State
You will create a transition from the On Hold
state to the
Open
state. In the Customization Project Editor for the
SalesOrdersCheckHold customization project, perform the following
instructions:
- In the navigation pane, click
The SO301000 (Sales Orders) State Diagram: Sales Order page opens.
. - On the page toolbar, click Diagram View.
- In the box with the
Open
state, click and hold the plus button, and draw a line from the box with theOpen
state to the box with theOn Hold
state. - In the Add Transition dialog box, which opens, click Create to the right of the Trigger Name box to add a new action.
- In the New Action dialog box, which opens, specify the
following settings:
- Action Name: putOnHoldAuto
- Display Name:
putOnHoldAuto (specified automatically)Tip: You do not need to specify the display name for the action because this action will not be displayed in the UI.
- Click OK to close the dialog box.
- In the Target State box of the Add
Transition dialog box, make sure that
On
Hold is selected, and click
OK, which closes the dialog box.
Notice that a label with the
putOnHoldAuto
action name has appeared in the box with theOpen
state. Also, an arrow, which represents the transition from theOpen
state to theOn Hold
state, has appeared in the diagram. - Save your changes.
Step 2: Adding New Transitions Between Other States and the On Hold state
You will create transitions from the Pending Processing
,
Awaiting Payment
, Credit Hold
, and
Back Order
states to the On Hold
state. While
you are still working with the diagram view of the SO301000 (Sales Orders) State
Diagram: Sales Order page, perform the following instructions:
- In the box with the
Pending Processing
state, click and hold the plus button, and draw a line from the box with thePending Processing
state to the box with theOn Hold
state. - In the Add Transition dialog box, specify the following
settings:
- Trigger Name: putOnHoldAuto
- Target State: On Hold (specified automatically)
- Click OK to close the dialog box.
- Save your changes.
- Repeat Instructions 1 through 4 for each of the following states:
Awaiting Payment
,Credit Hold
, andBack Order
.
Step 3: Duplicating the Settings of the Predefined Transitions in the Added Transitions
The transition from other states to the On Hold
state should have
the same settings as the respective transitions triggered by the predefined
Hold
action. Thus, you will adjust the new transitions by
duplicating the settings of the respective transitions triggered by the predefined
action. While you are still working with the diagram view of the SO301000 (Sales
Orders) State Diagram: Sales Order page in the Customization Project Editor, do the
following:
- Modify the transition from the
Open
state to theOn Hold
state as follows:- Click the transition from the
Open
state to theOn Hold
state that is initiated by theputOnHoldAuto
action, and on the context menu that is displayed, click the Edit button.The Transition dialog box opens.
- In the Fields to Update After Transition table of
the dialog box, click Add Row on the table
toolbar, and specify the following settings in the added row:
- Field Name: InclCustOpenOrders
- From Schema: Selected
- New Value: Cleared
- Click OK to close the dialog box.
- Save your changes.
- Click the transition from the
- Modify the transition from the
Back Order
state to theOn Hold
state as follows:- Click the transition from the
Back Order
state to theOn Hold
state that is initiated by theputOnHoldAuto
action, and on the context menu that is displayed, click the Edit button.The Transition dialog box opens.
- In the Fields to Update After Transition table of
the dialog box, click Add Row on the table
toolbar, and specify the following settings in the added row:
- Field Name: BackOrdered
- From Schema: Selected
- New Value: Cleared
- Click Add Row on the table toolbar again, and
specify the following settings in the added row:
- Field Name: InclCustOpenOrders
- From Schema: Selected
- New Value: Cleared
- Click OK to close the dialog box.
- Save your changes.
- Click the transition from the
- Modify the transition from the
Credit Hold
state to theOn Hold
state as follows:- Click the transition from the
Credit Hold
state to theOn Hold
state that is initiated by theputOnHoldAuto
action, and on the context menu that is displayed, click the Edit button.The Transition dialog box opens.
- In the Fields to Update After Transition table of
the dialog box, click Add Row on the table
toolbar, and specify the following settings in the added row:
- Field Name: Credit Hold
- From Schema: Selected
- New Value: Cleared
- Click OK to close the dialog box.
- Save your changes.
- Click the transition from the
Awaiting Payment
and Pending Processing
states
to the On Hold
state because the corresponding predefined
transitions do not update any fields after the transition is completed.Step 4: Duplicating the Settings of the Predefined Action in the Added Action
Because the putOnHoldAuto
action should put a sales order to hold,
the Hold
field should be set to True when this action is
performed, as is the case in the predefined putOnHold
action. Also,
this action should not be visible to users, because it is an auxiliary action that
the system uses to automatically put the sales order to hold on the Sales Orders (SO301000) form if it has an
Order Total of greater than $800 and it has not been put
on hold manually. To implement these settings, perform the following
instructions:
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) Actions page opens.
. - In the table, click the putOnHoldAuto link.
- In the Action Properties dialog box, which opens, do the
following:
- In the Hidden box, select True.
- On the Field Update tab, click Add
Row on the table toolbar, and specify the following
settings in the added row:
- Active: Selected
- Field: Hold
- From Schema: Selected
- New Value: Selected
- Click Add Row on the table toolbar again, and
specify the following settings in the added row:
- Active: Selected
- Field: Canceled
- From Schema: Selected
- New Value: Cleared
Tip: You can ensure that the predefinedputOnHold
action has the same settings on the Field Update tab.
- Click OK to close the dialog box and save your changes.
Step 5: Automating the Execution of Actions
You need to add a condition for the putOnHoldAuto
action so that
this action is performed automatically. With this action, a sales order should not
remain in the Open
state if its Order Total
is greater than $800 and it has not been put on hold manually.
To add a condition for the putOnHoldAuto
action, perform the
following instructions:
- In the navigation pane of the Customization Project Editor, click
The SO301000 (Sales Orders) State Diagram: Sales Order page opens.
. - On the page toolbar, click Diagram View.
- Click the More button in the box with the
Open
state, and click Edit State on the context menu.The State dialog box opens.
- On the Actions tab of the dialog box, click the row with
the
putOnHoldAuto
action, and select TotalMoreThan800 in the Auto-Run Condition column. - Click OK to close the dialog box.
- Save your changes.
- By using instructions that are similar to the last four instructions, add the
TotalMoreThan800 condition for the
putOnHoldAuto
action in thePending Processing
,Awaiting Payment
,Credit Hold
, andBack Order
states.