4. Build the Leave Request List View

In this step you will create a read-only list view that displays the leave requestor's records. You will use this list view in two ways:

Later, you will learn that the two forms (requester and approving manager) are actually the same form, just configured to display the previous requests based on the form's use.

  1. Design a new List View based on the Leave Request SmartObject and name it Leave Request List View then move it to the Views category. Change the View Type to List View and disable the Call this method when the form loads option. In a later step, you will configure a method action to call specific records when this view loads.
    1. Once again, you will design this view from the Leave Request SmartObject, creating a bind between the view and the data source. In this step, you will create a list view that returns multiple records (the requester's previous leave requests). (Recall that the item view created in the previous step returns a single record.).
      Right-click the Leave Request SmartObject and select Design View.
    2. Name the new view
      Leave Request List View
      then move it to the Views category.
    3. Change the View Type to List View. UNCHECK the option to Call this method when the form loads. (By default for a list view, K2 assumes you want to display all the records from the SmartObject when the view loads. In this case, you only want the records for the leave requester, not all the records to appear. In a later step, you will configure a rule that retrieves only the leave requester's records.) Click CREATE. List View General Settings
  2. Create the labels and controls, then add the following fields:
    • Leave Request Title
    • Employee Name
    • Leave Start Date
    • Leave End Date
    • Leave Type
    • Request Status

    The Leave Request List View
    Leave Request List View

    1. Select Create Labels and Controls.
      Create Labels and Controls
    2. On the Create Labels and Controls screen, Include the following fields:
      • Leave Request Title
      • Employee Name
      • Leave Start Date
      • Leave End Date
      • Leave Type
      • Request Status
    3. To avoid any changes to the records, keep the Enable list editing option disabled. There are no other changes to the layout editor, so click OK.
      Select List View Fields to Display
    4. Click FINISH to save and exit the view.
Review

In this step, you created a list view from the Leave Request SmartObject. This view is read-only since you do not want the approver to make any changes to the request details. In the next step, you will create the Leave Request Form.

Next Step: 5. Build the Leave Request Form