How to Make the Group Client UI Read-only when the Status is not 'Changed'

This page explains how to configure a Group Client JET UI to make the page read-only when the group client is not in the status Changed. This use case is applicable to the View and Edit Recursive floor plan template.

Use Case

The seeded group client page allows a user to edit and delete group clients independent of the group client’s status. The requirement is to allow edit and deletes only on group clients that have the status 'Changed'.

Step 1. Copy an Existing Floor Plan

Copy the seeded Group Client View and Edit Recursive floor plan by creating a new floor plan, setting the properties and copy the json payload.

Step 2. Set the Floor Plan Properties

  • Set Create Enabled? to checked, meaning that the user is allowed to create new objects through this floor plan.

  • The system sets System Specific? automatically to not checked, meaning that the user can change this floor plan.

  • Set Auto Include Extensibility? to not checked, meaning that the floor plan does not automatically include all the group client’s dynamic fields and dynamic records.
    The required dynamic fields and records must be specified in the json.

  • Set the context based condition to

    context.status!="CHANGED"

    and set the priority of the floor plan to 1.

    When evaluating which floor plan to load, the system orders the selected floor plans on priority ascending, where a priority of null is considered the lowest priority. Then the system applies the conditions and selects the first floor plan that meets the criteria.

    The priority 1 of our new floor plan is a higher priority than the priority null of the seeded floor plan.
    So the system first evaluates our new floor plan before evaluating the seeded floor plan.
    For a group client that does not have the status CHANGED, the condition results in true, meaning that the system loads our new floor plan.
    For a group client that does have the status CHANGED, the condition of the first floor plan evaluates to false, the floor plan is skipped and the system evaluates the floor plan next in line: the seeded floor plan. The seeded floor plan has no condition and the system therefore loads this floor plan.

So for group clients that do not have status CHANGED the system loads our new floor plan. For group clients that do have the status CHANGED, the system loads the system floor plan.

Step 3. Set the JSON payload

In the Group Client floor plan json remove the "edit" and "delete" actions from the "resource": "groupclients" section
This will turn the floor plan into a view-only mode.

"actions": [
    "edit",
    "delete"
],
Removing these actions from the group client, automatically sets all the tabs to view-only mode also.

The button to set the group client status to Changed is still valid as this is driven by user access restriction and not through the floorplan configuration. This gives the user the option to set the status and saving the group client. After saving, the system re-queries the group client.

As the status of the group client is now Changed, the condition

 context.status!="CHANGED

no longer applies. Therefore the new floor plan is not selected, the system uses the system floor plan that enables view and edit actions.