Oracle by Example brandingUsing Form Control Extensions to Dynamically Hide and Show Fields

section 0Before You Begin

This 30-minute OBE (Oracle by Example) shows you how to add fields to a form using form extensions and create logic extensions using form control functions to hide, conditionally show, and highlight controls on a form.

In this OBE, you will:

  • Create a logic extension with a form control extension to hide controls (fields) on a form.
  • Create a logic extension with a form control extension to conditionally show controls on a form and also highlight the control.
  • Create a form extension and add three fields to a form.
  • Associate the logic extensions to events on the form.
  • Test the logic extension.

Background

Forms are the fundamental components of EnterpriseOne interactive applications, and those forms are made up of various form controls, such as input fields, buttons, and grids. Logic extensions give designers the ability to extend the underlying processing logic in applications, for example, to manipulate numbers, dates, strings, and to read and write data to EnterpriseOne tables.
This feature enhances logic extensions with the ability to act on the properties of controls on the form, for example, to show, hide, enable, disable, or change the color of a field. For example, with form control extensions you could determine the value a user has entered in a field, and based on that value conditionally enable, disable, or highlight a different control. Being an enhancement to logic extensions, form control extensions are also user-defined objects, so they inherit all the ease of low code/no code development and deployment as with logic extensions.

What Do You Need?

To perform the steps in this OBE, you will need:

  • Access to a JD Edwards EnterpriseOne environment with Tools Release 9.2.7.3 or later. JD Edwards EnterpriseOne Trial Edition running on Oracle Cloud Infrastructure is suitable, but you can use any environment with the proper Tools release.
  • Security access to use Orchestrator Studio.

Scenario

In this OBE, you will modify the Job Master Revisions form to conditionally show a set of controls, in this case input fields, based on the value in the Type Business Unit field.

If the value in the Type Business Unit field is JB, then the form displays these three additional fields:

  • Branch Type
  • Billing Type
  • Cost at Completion

But if the value in the Type Business Unit field is anything other than JB then these fields are not displayed.


section 1Creating a Form Control Extension to Hide a List of Controls

  1. Sign in to the Orchestrator Studio.
  2. Click Logic Extensions.
  3. Click the New button.
  4. In the Name field, enter Hide a List of Controls and in the Description field, enter A form control extension to hide a list of controls on a form.
  5. In the Data Structure tab, click +Add Control.
  6. From the Data Type column drop-down list, select Form Control List.
  7. In the Name column, rename the item as Controls to Hide.
  8. Logic Extension - Data Structure
    Hide a List of Controls Logic Extension  - Data Structure Tab
  9. Click the Logic tab.
  10. Click the + between the Start and End nodes, and from the context menu, select Form Control Function.
    The Form Control Function panel is displayed on the right.
  11. In the Form Control Function panel, complete the following fields:
    • Label: Controls to Hide
    • Description: Controls to hide upon form entry
    • Function Name: Hide Control
    • Control: Controls to Hide
  12. Hide a List of
                      Controls Logic Extension - Controls to Hide Form Control Function
    Hide a List of Controls Logic Extension - Controls to Hide Form Control Function
  13. Click Save.
    In a later section, you will understand how to use a form extension to associate the Hide a List of Controls logic extension to a form and hide the fields added to the form.

section 2Creating a Form Control Extension to Conditionally Show and Highlight Controls

  1. To create a new logic extension with the form control extension function, click the Logic Extensions link and click New.
    Logic
                        Extensions Link
    Logic Extensions Link

  2. Complete the following fields:
    Name: Show Extended Controls
    Description: Show and highlight extra controls based on the input value of some trigger field.
  3. In the Data Structure tab, click the +Data Dictionary button.
    The Data Dictionary window is displayed.
  4. In the Alias field, enter A301 and click +.
    This is the data dictionary item for a string field.
  5. Change the value in the Name field as Field Trigger.
  6. Verify that the value in the IO Type field is selected as Input Only.
  7. Click the +Add Control button.
  8. From the Data Type drop-down list, select Form Control List.
  9. Rename the value in the Name column for the form control as Controls to Show.
  10. Click + Add Control to add another control.
  11. From the Data Type drop-down list, select Form Control List.
  12. Change the value in the Name column as Controls to Highlight.
  13. Logic Extension - Data Structure
    Show Extended Controls Logic Extension - Data Structure Tab
  14. Click Save.
  15. In the Logic tab, click + between the Start and End nodes, and from the context menu, select If Else.
    The If Else panel is displayed on the right.
  16. In the If Else panel, complete the following fields:
    • LabelCheck Field Value
    • Description: Evaluate the value of a trigger field
    • If Branch Label: True
  17. Click the Launch Criteria Builder (Edit) icon.
    The Criteria Builder window is displayed and the Edit icon in the Left Operand field is highlighted.
  18. From the right panel (Object Selector panel), click Field Trigger.
    In the Compare Operator field, the value is equal to is displayed automatically, and the Edit icon in the Right Operand field is highlighted.
  19. In the right panel, click the Literal icon. In the Single Value field, enter JB, and click OK.
  20. Criteria Builder
                      Window
    Criteria Builder Window
  21. Close Criteria Builder. Verify that the If Else panel is displayed as shown in the following screenshot:
  22. If Else
                      Panel Criteria - Field Trigger = JB
    If Else Panel Criteria - Field Trigger = JB
  23. In the design panel, hover over the line after the True label, click +, and from the context menu, select Form Control Function.
    The Form Control Function panel is displayed on the right.
  24. In the Form Control Function panel, complete the following fields:
    • Label: Show Controls
    • Description: Show controls
    • Function Name: Show Control
    • Control: Controls to Show
    Form Control Function Panel
    Form Control Function Panel
  25. Hover over the line below the Show Controls step and click +, then select another Form Control Function from the context menu.
    The Form Control Function panel is displayed on the right.
  26. In the Form Control Function panel, complete the following fields:
    • Label: Highlight Controls
    • Description: Highlight controls
    • Function Name: Set Edit Control Color
    • Control: Controls to Highlight
    • Color: Yellow
  27. Click Save.
  28. Show Extended
                      Controls Logic Extension - Form Control Function Panel
    Show Extended Controls Logic Extension - Form Control Function Panel

section 3Creating a Form Extension to Add Fields to a Form

  1. Sign in to the JD Edwards EnterpriseOne application.
  2. Navigate or Fast Path to Job Cost Master Revisions (P51006).
  3. Click Find to load a list of jobs in the grid.
  4. Select any row in the grid and click Select.
    The Job Master Revisions form is displayed.
  5. Click the Form Extension icon. The Form Extension Manager panel is displayed.
  6. Add the following fields to the form by dragging them to a clear space on the form, as shown in the following screen shot:
    Note:
    You might have to drag the blue box and the other frames to make the form wider.

    • Branch Type
    • Billing Type
    • Amount – Cost at Completion
    Job Master
                        Revisions Form - Form Extension Manager
    Job Master Revisions Form - Form Extension Manager
  7. Click Save.

section 4Associating the Form Control Extensions to Events on the Form

  1. In Form Extension Manager, click the Associate Orchestrations link.
  2. In the Associate Orchestrations wizard, click in the Control field to set the cursor focus inside the field.
  3. Click in the blank space inside the blue frame, but not on any individual control, to select the form as the control. Verify that the value Job Master Revisions is displayed in the Control field.
  4. Select the Dialog is Initialized event.
  5. Job Master
                      Revisions Form - Associate Orchestrations Wizard
    Job Master Revisions Form - Associate Orchestrations Wizard
  6. Click the Logic Extensions tab.
  7. Click Next.
  8. In Step 2 of the Associate Logic Extensions wizard, click the Select Logic Extension drop-down list. Select the Hide a List of Controls logic extension that you created in Section 2 of this OBE (Creating a Form Control Extension to Hide a List of Controls).
  9. Associate Logic
                      Extensions Wizard - Step 2
    Associate Logic Extensions Wizard - Step 2
  10. Click Next.
  11.  In Step 3 of the Associate Logic Extensions wizard, click the Map Form Controls tab and click the Default Array icon.
    A mapping grid is displayed.
  12. Associate Logic
                      Extensions Wizard - Default Array Icon
    Associate Logic Extensions Wizard - Default Array Icon
  13. Use the cursor to move the Associate Logic Extensions wizard to the right so that you can see the Branch Type, Billing Type, and Cost at Completion fields that were added in Section 1 of this OBE (Creating a Form Extension to Add Fields to a Form).
  14. Job Master
                      Revisions Form - Associate Logic Extension Wizard
    Job Master Revisions Form - Associate Logic Extension Wizard
  15. Click in the Click Input Fields to Map field, then use the cursor to select the Branch Type label on the form.
    Verify that Branch Type appears in the Click Input Fields to Map field.
  16. Repeat step 11 for the Branch Type field. Next repeat this step for the Billing Type label and Billing Type field, and the Cost at Completion label and Cost at Completion field.
    When you map all the labels and fields, the six rows are displayed in the Controls to Hide grid as shown in the following screenshot:
    Step 3
                        Associate Logic Extensions - Controls to Hide Mapping                        Grid
    Step 3 Associate Logic Extensions - Controls to Hide Mapping Grid
  17. Click Save.
  18. Click Next.
  19. In Step 4 of the Associate Logic Extensions wizard, click Next.
  20. In Step 5 of the Associate Logic Extensions wizard, click Save, as the Controls to Hide logic extension has no outputs.
    Step 1 of the Associate Logic Extensions wizard is displayed.
    Next, repeat the process to associate the second (Show Extended Controls) logic extension to this form.
  21. In the Associate Orchestrations wizard, click in the Control field to set the cursor focus inside the field.
  22. On the form, click in the blank space inside the blue frame, but not on any individual control, to select the form as the control. Verify that the value Job Master Revisions is displayed in the Control field.
  23. Select the Post Dialog is Initialized event.
  24. Associate Logic
                      Extensions Wizard - Post Dialog is Initialized Event
    Associate Logic Extensions Wizard - Post Dialog is Initialized Event
  25. Click the Logic Extensions tab.
  26. Click Next.
  27. In Step 2, in the Logic Extension Name drop-down list, select the Show Extended Controls logic extension created in Section 3 of this OBE (Create a Form Control Extension to Conditionally Show and Highlight Controls).
  28. Associate Logic
                      Extensions Wizard Step 2
    Associate Logic Extensions Wizard Step 2
  29. Click Next.
    Step 3 is displayed.
  30. In the Define Inputs tab, click in the Mapping Input field. Then use the cursor to select the Type Business Unit field on the form.
    Note: Make sure to select the Type Business Unit field and not the label. Verify that the value Type Business Unit is displayed in the Mapping Input field.
  31. Associate Logic
                      Extensions Wizard Step 3
    Associate Logic Extensions Wizard Step 3
  32. Click the Map Form Controls tab.
  33. Next to Controls to Show, click the Default Array icon.
    A mapping grid is displayed.
  34. Use the cursor to move the Associate Logic Extensions wizard to the right so that you can see the Branch Type, Billing Type, and Cost at Completion fields that were added in Section 1 of this OBE (Creating a Form Extension to Add Fields to a Form).
  35. Click in the Click Input Fields to Map field, then use the cursor to select the Branch Type label on the form.
    Verify that the value Branch Type is displayed in the Mapping Control field.
  36. Repeat step 28 for the Branch Type field. Next repeat the step for the Billing Type label and field, and the Cost at Completion label and field.
    When you map all the labels and fields, the six rows are displayed in the Controls to Show grid as shown in the following screenshot:
  37. Controls to Show
                      Mapping Grid
    Controls to Show Mapping Grid
  38. Click Save.
  39. Next to Controls to Highlight, click the Default Array icon.
    A mapping grid is displayed.
  40. Click in the Click Input Fields to Map field, then use the cursor to select the Billing Type control on the form (not the label).
    Note: Verify that Billing Type is displayed in the Click Input Fields to Map field.
  41. Logic Extension
                      - Data Structure
    Logic Extension - Data Structure
  42. Click Save.
  43. Click Next.
  44. In Step 4, click Next.
  45. In Step 5, click Save, as the Controls to Highlight logic extension has no outputs.
  46. Click Close to close the Associate Logic Extensions wizard.
  47. In the Form Extension Manager panel, click Save.
  48. Close the Form Extension Manager.

    You have now associated the two logic extensions with events on the form.

    When the form first opens (the Dialog is Initialized event), the Hide a List of Controls (first) logic extension will hide the three labels and fields. Immediately following that event, if the value of Type Business Unit field is JB, the Post Dialog is Initialized event will run the Show Extended Controls (second) logic extension.

    The next section explains how to test the form control extensions. 

section 5Testing the Form Control Extensions

In this section, you will open and test two records in the Job Master Revisions form.

For the record with the Type Business Unit value of JB, the additional fields are displayed. For the record with Type Business Unit value other than JB, the additional fields are not displayed.

  1. Close the Job Master Revisions form to return to Job Cost Master Revisions (P51006).
  2. Verify that the value in the Job Type field is JB.
  3. Click Find.
  4. Work with Job Master -
                      Job Type Field JB
    Work with Job Master - Job Type Field JB
  5. Select any row in the grid and click the Select button.
    The Job Master Revisions form is displayed.
    Notice that the form now includes the three fields you added, and that the Billing Type field is highlighted in Yellow.
    The fields are displayed because the value in the Type Business Unit field is JB.
  6. Job Master Revisions
                      Form with Fields
    Job Master Revisions Form with Fields
  7. Close the Job Master Revisions form.
  8. On Work with Job Master, in the Job Type header field, delete the value JB and click Find.
    The grid displays all the results that do not have the value JB in the Job Type field.
  9. Work with Job Master
                      Form - Job Type is not JB
    Work with Job Master Form - Job Type is not JB
  10. Select any row in the grid and click the Select button. 
    The Job Master Revisions form is displayed.
    Verify that the form does not include the three fields you added. That is because the value in the Type Business Unit field is something other than JB.
  11. Job Master Revisions
                      Form without Fields
    Job Master Revisions Form without Fields

section 6Conclusion

In this OBE, you learned how to:

  • Create a logic extension with a form control extension to hide controls (fields) on a form.
  • Create a logic extension with a form control extension to conditionally show controls on a form and also highlight the control.
  • Create a form extension and add three fields to a form.
  • Associate the logic extensions to events on the form. The Dialog Is Initialized event launches the form extension to hide the added fields, and the Post Dialog Is Initialized event runs after that event and displays the added fields if the form meets some condition, in this case, Type Business Unit = JB.
  • Using these skills and this same pattern, you could create logic extensions that accept inputs from forms, evaluate values for If/Then paths, and selectively show, hide, enable, disable, set control text, and set control color.

more informationWant to Learn More?