Conditional Properties: To Hide a Element

The following activity will walk you through the process of conditionally hiding a box on the form. You will do this by configuring the underlying field to be hidden when the condition is met.

Story

Suppose that the employees of your company often work with the Cases (CR306000) form. Further suppose that you want to hide the boxes that contain the billable time and overtime of a case if the case is not billable. You need to configure a condition that checks whether the Billable check box on the CRM Info tab is selected.

Process Overview

On the Customized Screens page, you will add the Cases (CR306000) form so that it can be customized. By using the Conditions page, you will create a condition. On the Fields page, you will specify the created condition as a value for the Hidden property for the underlying fields of the Billable Time and Billable Overtime boxes; these settings will cause the boxes to be hidden if the condition is met. You will then publish the project. Finally, you will test the condition on the Cases form.

System Preparation

Before you begin performing the steps of this activity, do the following:

  1. Prepare an MYOB Acumatica instance by performing the Customization Projects: To Deploy an Instance prerequisite activity.
  2. Create the Yogifon customization project by performing the Customization Projects: To Create a Customization Project prerequisite activity.

Step 1: Modifying the List of Customized Screens

To hide a box on the Cases (CR306000) form, you first need to add the form (screen) to the list of customized screens. In the Customization Project Editor, do the following:

  1. In the navigation pane, click Screens.

    The Customized Screens page opens.

  2. On the page toolbar, click Customize Existing Screen.

    The Customize Existing Screen dialog box opens.

  3. In the Select Screen box of the dialog box, click the magnifier button. In the lookup table, type CR306000 in the Search box and double-click the Cases form.
  4. Click OK to close the dialog box.

    The Cases form is added to the list of forms on the Customized Screens page, and the Screen Editor: CR306000 (Cases) page opens.

Step 2: Defining the Condition

Suppose that you have already learned that the field name of the Status box of the Cases (CR306000) form is the same as the box name. To define the condition, do the following in the Customization Project Editor:

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

    The Conditions page opens.

    Tip: In the name that appears on the page, Conditions: CR306000 (Cases), Conditions is followed by the form ID and then the form name in parentheses.
  2. On the page toolbar, click Add New Record.
  3. In the Condition Properties dialog box, which opens, enter the name of the condition: Billable.
  4. In the table, add a row with the following settings:
    • Active: Selected
    • Field Name: Billable
    • Condition: Equals
    • Form Schema: Selected
    • Value: Cleared
  5. Click OK to save your changes and close the dialog box.

Step 3: Specifying the Condition for the Property

Do the following to specify the condition as the value of the Hidden property of the Billable Time field and the Billable Overtime fields:

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

    The CR306000 (Cases) 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: Case (Case Summary)
    • DAC: PX.Objects.CR.CRCase (specified automatically)
    • Field Name: Billable Time
  4. In the table, select the unlabeled check box in the only row and click Add & Close to save your changes.

    The dialog box is closed, and the added field appears in the table on the Fields page.

    Tip: In the name that appears on the page, CR306000 (Cases) Fields, Fields is preceded by the form ID and then the form name in parentheses.
  5. On the page toolbar, click Add New Record again.
  6. In the Add Field dialog box, which opens, specify the following settings:
    • Container: Case (Case Summary)
    • DAC: PX.Objects.CR.CRCase (specified automatically)
    • Field Name: Billable Overtime
  7. Select the unlabeled check box in the only row of the table, and click Add & Close to save your changes.

    The dialog box is closed, and the added field appears in the table on the Fields page.

  8. In the Hidden column of both the TimeBillable row and the OvertimeBillable row, select Billable.

    With these settings, if the Billable condition is met on the Cases (CR306000) form (that is, if the case is billable), the Billable Time and Billable Overtime boxes will be hidden.

  9. Save your changes.
  10. To apply the changes to the instance, on the main menu of the Customization Project Editor, click Publish > Publish Current Project.
  11. Wait until the Website updated row appears in the Compilation pane, and click Close Compilation Pane.

Step 4: Testing the Condition

Now you can test the condition. Do the following on the Cases (CR306000) form in MYOB Acumatica:

  1. Create a case, and specify the following settings:
    • Case Class: SERVCONS

      According to the settings specified on the Case Classes (CR206000) form, cases of this class are billable.

    • Business Account: C000000094
    • Contact: Figer, Guillaume (inserted automatically)
    • Subject: Installation consulting
  2. Save your changes.
  3. In the Billing section of the CRM Info tab, notice that the Billable check box is selected and that the Billable Time and Billable Overtime boxes are displayed below the Billable check box.
  4. Create another case, and specify the following settings:
    • Case Class: SUPPORT

      According to the settings specified on the Case Classes (CR206000) form, cases of this class are not billable.

    • Business Account: C000000095
    • Contact: Yuan, Yi Xiang (inserted automatically)
    • Subject: Scheduled maintenance
  5. Save your changes.
  6. In the Billing section of the CRM Info tab, notice that the Billable check box is cleared and that the Billable Time and Billable Overtime boxes are not displayed.