14. Set the Requester's Details on the Manager's Approval Form

In this step, you will edit the Workflow Task state, form initializing rule, and add an action to load the leave requester's previous leave requests into the Leave Request List View. In the last step, you configured the form initializing rule for the default state, or the form configuration the requester sees. You configured the rule to use the current user's system email value as the SmartObject record filter. The Workflow Task state is the configuration the approving manager sees. You don't want the current user's records for the approval step though, because the current user is the manager! You will configure the rule to use the requester's email as the filter and not the current user's system email value.

You will also hide the Create button for the approving manager as the manager will not add any new records.

  1. Like the previous step, you will first add an action to retrieve the requester's leave requests. Edit the form initializing rule on the Workflow Task state. Execute a get list method for the Leave Request List View.
    1. Begin by editing the rule that runs when the form first loads, or initializes, for the approving manager. Highlight the Workflow Task state, then edit the When the Form is Initializing rule. This state represents the form and rule configuration for the approving manager.
      Edit Form Initializing Rule
    2. Confirm the Actions tab is active, the add an Execute a View method action to the rule definition pane. For the view, select Leave Request List View. For the method, select Get List.
      Execute a View Method View and Method Configuration
  2. Next, you will map the Employee Email property from the SmartObject instead of the System Value email. Map the Employee Email property from the Leave Request Item View > Leave Request SmartObject to the Employee Email input mapping.
    1. Recall in the last section, you configured the system email value as the filter for the Previous Leave Requests list view. The system value email represents the current user's email value. You do not want the current user's previous leave requests because the current user for this state is the approving manager! Therefore, you need to map the email address from the SmartObject record itself that is the email for the leave requester. You want to retrieve the leave requester's previous requests for the manager to review.
      Click (configure). Expand the Context Browser > Leave Request Form > Leave Request Item View > Leave Request SmartObject nodes. Drag the Employee Email into the Employee Email input property.
      Use SmartObject Property for Input Properties
  3. Map the return properties to the Leave Request List View output mappings.

    Like previous step, you will map the output mappings. These are the properties that ultimately become the list view values. Map the Return Properties to the Leave Request List View > Controls > Display Row(s) properties.

    1. Click Output Mappings. Map the Return Properties to the Leave Request List View controls. You may have to collapse the item view to see the list view in the Mapping Destinations pane. Click FINISH.
      Mapping Output Properties
  4. The last rule configuration you will make is to hide the create button on the item view. The approving manager will not add any new records, so this button may be confusing. After you hide the control, finish, then check in the form.
    1. Next, you will hide the create button. Remember that this state is the form behavior that the approving manager sees. The manager will not create any new leave requests, they are just reviewing and taking action on the requester's leave requests. Since this button may be confusing if it's displayed, you will hide it for this state. With the Actions tab active, search for
      hide
      then click Hide a View control to add it to the rule definition pane. Click the select View link and choose Leave Request Item View. Click the select control link and choose Create Button.Click OK to close the Rule Designer, then click FINISH to save and exit the form.
      Hide a View Control
    2. Right-click the Leave Request Form and select Check In. If you see a message about checking in associated views, check the boxes next to the views, then click OK.
Review

In this step, you edited the form initialing rule for the Workflow Task state. This is the form configuration and behavior the approving manager sees. You added an action to execute a view method (Leave Request List View, Get List method) to populate the list view with the requester's leave requests (instead of the current user's records). You hid the create button from this state, because the manager will not create new records. The workflow configuration is now complete! In the next step, you will test the Leave Request application.

Next Step: 15. Test the Leave Request (Basic Version) Application