Workflow-Identifying Fields: To Add Conditions with User-Defined Fields

The following activity will walk you through the process of creating workflow conditions with user-defined fields.

User-defined fields are fields an organization can add directly to the MYOB Acumatica data entry forms to gather information that is important to the organization but does not already appear on the form. The fields can be displayed on the User-Defined Fields tab if the user should enter their values, or they can be hidden if they will be used internally. These fields are based on predefined and site-specific attributes that have been defined in the system. For details on user-defined fields, see Managing Attributes and User-Defined Fields.

Story

Acting as a technical specialist, you need to add the following conditions to the workflow of sales orders on the Sales Orders (SO301000) form:

  • TotalMoreThan800, which will be used to automatically put a sales order on hold if its Order Total is greater than $800 and the sales order has not been yet reviewed
  • TotalLessThan800, which will be used to automatically remove a sales order from hold if its Order Total is less than $800 and it has not been put on hold manually
Because the system does not store information about whether the sales order has been reviewed or whether it has been put on hold manually, you need to create user-defined fields for the workflow of sales orders with the SO type. One field will be used to check if a sales order has been put on hold manually, and another will be used to check whether it has already been removed from hold. Because these fields will be used only internally, you will define them to be hidden.

Process Overview

On the Attributes (CS205000) form, you will create the attributes that you will use for user-defined fields. You will then add user-defined fields for these attributes on the Edit User-Defined Fields (CS205020) form. As an optional step, you will add the created fields to the customization project on the User-Defined Fields page of the Customization Project Editor.

By using the Fields page, you will make the fields hidden on the Sales Orders (SO301000) form because these fields represent internal flags that should not be displayed to users.

By using the Conditions page, you will add the conditions that use the user-defined fields.

System Preparation

Before you begin adding a new state, do the following:

  1. Launch the MYOB Acumatica website with the U100 dataset preloaded, and sign in as a 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.
  2. Make sure that you have learned how to configure conditions, as described in Conditions and Transitions: General Information.
  3. Make sure that you have completed the Workflow-Identifying Fields: To Create an Inherited Workflow activity.

Step 1: Creating Attributes

In this step, you will create the attributes that will correspond to the user-defined fields. In MYOB Acumatica, perform the following instructions:

  1. On the Attributes (CS205000) form, create an attribute with the following settings:
    • Attribute ID: SOONHOLD
    • Description: SO On Hold
    • Control Type: Checkbox

    You will use this attribute to check whether a sales order has been put on hold manually, and to keep the sales order on hold if its Order Total is less than $800.

  2. On the form toolbar, click Save.
  3. Add another attribute with the following settings:
    • Attribute ID: SOREVIEW
    • Description: SO Reviewed
    • Control Type: Checkbox

    You will use this attribute to check whether a sales order was manually removed from hold previously.

  4. On the form toolbar, click Save.

Step 2: Adding User-Defined Fields to the Form

In this step, you will add to the Sales Orders (SO301000) form the user-defined fields that correspond to the attributes you have created. In MYOB Acumatica, perform the following instructions:

  1. Open the Sales Orders (SO301000) form.
  2. On the form title bar, click Customization > Manage User-Defined Fields.
  3. On the Edit User-Defined Fields (CS205020) form, which opens, add user-defined fields for the created attributes as follows:
    1. On the form toolbar, click Add User-Defined Field.
    2. In the Attribute ID box of the User-Defined Field Parameters dialog box, which opens, select SOONHOLD.
    3. Click OK to save your changes and close the dialog box.
    4. On the form toolbar, click Add User-Defined Field again.
    5. In the Attribute ID box of the User-Defined Field Parameters dialog box, select SOREVIEW.
    6. Click OK to save your changes and close the dialog box.
  4. Click the back arrow to save the added fields and return to the Sales Orders form.
Tip: For specified types of sales orders, you can control whether each added user-defined field is disabled, whether it is required, and whether it is hidden. To do so, you use the Properties tab of the Edit User-Defined Fields (CS205020) form. On the tab, you select the needed sales order type in the Order Type box. In the table with the user-defined fields, you can then select any of the following check boxes for each field: Required, Hidden, and Disabled.

Step 3 (Optional): Adding the User-Defined Fields to the Customization Project

As an optional step, you can add the user-defined fields you have created to your customization project. In this case, it will be possible to export the customization project and then import and publish it on another instance without the need to create user-defined fields on this instance manually. To add the fields to the customization project, do the following:

  1. For the SalesOrdersCheckHold customization project, in which you have created a customized workflow in Workflow-Identifying Fields: To Create an Inherited Workflow, open the Customization Project Editor.
  2. In the navigation pane, click User-Defined Fields.

    The User-Defined Fields page opens.

  3. On the page toolbar, click Add New Record.
  4. In the Add User-Defined Fields dialog box, which opens, select the unlabeled check boxes in the rows with the SOONHOLD and SOREVIEW attribute IDs.
  5. Click Save to close the dialog box and save your changes.

    The selected user-defined fields have been added to the customization project.

Step 4: Hiding the User-Defined Fields from the Form

To add the user-defined fields to the workflow and hide them on the Sales Orders (SO301000) form, in the Customization Project Editor for the SalesOrdersCheckHold customization project, perform the following instructions:

  1. In the navigation pane, click Screens > SO30100 > Fields.

    The SO30100 (Sales Orders) Fields page opens.

  2. On the page toolbar, click Add New Record.
  3. In the Add Field dialog box, which opens, specify the following settings:
    • Container: Document (Order Summary)
    • DAC: PX.Objects.SO.SOOrder (Sales Order) (specified automatically)
    • Field Name: SO On Hold
  4. Select the unlabeled check box in the added row.
  5. Click Add & Close to save your changes and close the dialog box.

    The added field appears in the table on the SO30100 (Sales Orders) Fields page.

  6. On the page toolbar, click Add New Record again, and specify the following settings:
    • Container: Document (Order Summary)
    • DAC: PX.Objects.SO.SOOrder (Sales Order) (specified automatically)
    • Field Name: SO Reviewed
  7. Select the unlabeled check box in the added row.
  8. Click Add & Close to save your changes and close the dialog box.
  9. In the rows with the AttributeSOONHOLD and AttributeSOREVIEW fields, select True in the Hidden column.
    Tip: As an alternative to defining these fields as hidden in the field properties, you can select the Hidden check box for these user-defined fields on the Edit User-Defined Fields (CS205020) form.
  10. Save your changes.

    The SO30100 (Sales Orders) Fields page with the added fields should look as shown in the following screenshot.

    Figure 1. The SO30100 (Sales Orders) Fields page


Step 5: Adding Conditions

In this step, you will add conditions to be used for SO sales orders in the SalesOrdersCheckHold customization project. In the Customization Project Editor for this customization project, perform the following instructions:

  1. In the navigation pane, click Screens > SO30100 > Conditions.

    The Conditions: SO30100 (Sales Orders) page opens.

  2. On the page toolbar, click Add New Record.
  3. In the Conditions Properties dialog box, which opens, type TotalMoreThan800 as the condition name.
  4. Add two rows with the following settings.
    Field Name Condition From Schema Value Operator
    Order Total Is Greater Than or Equal To Selected 800 And
    SO Reviewed Equals Selected Empty And
  5. Make sure that the Active check box is selected for the added rows.
  6. Click OK to save your changes and close the dialog box.

    The added condition appears in the list of conditions on the Conditions: SO30100 (Sales Orders) page.

  7. By using instructions that are similar to Instructions 2 through 6, add the TotalLessThan800 condition to check whether the Order Total is less than $800. Specify the following settings in the rows of the Conditions Properties for this condition.
    Field Name Condition From Schema Value Operator
    Order Total Is Less Than Selected 800 And
    SO On Hold Equals Selected Empty And

    The condition should look as shown in the following screenshot.

    Figure 2. The TotalLessThan800 condition