Search Results for

    Show / Hide Table of Contents

    Build the caseworker site

    Introduction

    Caseworkers need one page: Applications, a list of all applications with an Approve and a Reject button. The buttons must work only on applications that wait for a decision, so a caseworker cannot decide twice.

    Create the grid widget

    1. Check that Grant Applications is selected in the product selector.

    2. Open Widgets, click Create and choose Grid View. In Title, type Applications and click Save.

    3. Open Data and choose the Data Source GaApplication. Keep Query Type BsonDocument and the query Casewhere suggests: it lists the records of all open cases, which is every application.

      The data of the Applications grid

    4. Open Columns and drag ReferenceNumber, ApplicantName, ProjectTitle, RequestedAmount, Status, SubmittedAt and DecidedBy into the column list.

      The columns of the Applications grid

    Add the Approve and Reject buttons

    1. Open Actions, click Add and choose Trigger a Workflow. Fill in General:

      Field Value
      Name approve
      Label Approve
      Workflow Definition Ga Approve Application
      Force Reload Data ☑

      There is no Process field this time: the workflow works on an application that already has its case.

    2. Open the action's Advanced tab and fill in Client Enable Rule:

      model.selectedDOs[0].Status == 'Submitted'
      

      The Client Enable Rule of the Approve button

      Casewhere already enables the button only when a row is selected, because the workflow requires an input. The rule adds a condition of yours: model.selectedDOs holds the selected rows, so the button is enabled only for an application whose status is Submitted.

    3. Click Save. An action is saved with the widget, and must be saved before you add the next one.

    4. Add the Reject button the same way: Name reject, Label Reject, Workflow Definition Ga Reject Application and the same rule.

    5. Click Save And Close.

    Important

    A client rule only changes the browser's buttons. Rules that protect data must also run on the server: for example, the decision workflows can check the status in a script, and an access rule on the workflows can let only caseworkers run them.

    Create the page

    1. Open Pages, click Create, and fill in Title Applications and Url applications.

    2. Open Layout, choose Widget Gallery and drag Applications onto the layout. Keep Use shared instance and click Add.

    3. Open Menu and tick Grant Caseworker.

      The Applications page in the Grant Caseworker menu

    4. Click Save And Close.

    Next: Try it end to end.

    In This Article
    Back to top Generated by DocFX