Get started > Use case scenarios - customizing with business rules > Setting a closed record to read-only

Setting a closed record to read-only

After a record has been closed, the user should not be able to update it. You can define a business rule to prevent further updates to the record.

The following are several options for defining the rule:

Option 1

  1. From the main menu, select Administration > Configuration > Records > Processes and Rules.
  2. Select the Request record type.
  3. Select the Done metaphase.
  4. In After change, click Add, then select Simple rule.
  5. In Validation rules, select Validate expression.
  6. Click OK.
  7. Click expression, and enter ${current_update.PhaseId.IsChanged}.
  8. Click error message, and enter The record is closed and cannot be edited.
  9. Click Save.

In this case, the request cannot be updated after reaching the Done metaphase under any circumstances.

Option 2

  1. From the main menu, select Administration > Configuration > Records > Processes and Rules.
  2. Select the Request record type.
  3. Select the Done metaphase.
  4. In After change, click Add, then select Simple rule.
  5. In Validation rules, select Validate expression.
  6. Click OK.
  7. Click expression, and enter ${current_update.PhaseId.IsChanged || current_user.IsPermitted('EMS-Admin-Template(entityType=Request)')}.
  8. Click error message, and enter The record is closed and cannot be edited.
  9. Click Save.

In this case, the request cannot be updated after reaching the Done metaphase unless the current user has Admin permission.

Option 3

  1. From the main menu, select Administration > Configuration > Records > Processes and Rules.
  2. Select the Request record type.
  3. Select the Done metaphase.
  4. In After change, click Add, then select Simple rule.
  5. In Validation rules, select Validate expression.
  6. Click OK.
  7. Click expression, and enter ${current_update.PhaseId.IsChanged || current_user.IsPermitted('EMS-Admin-Template(entityType=Request)') || (now() - entity.CloseTime)<3600000)}.
  8. Click error message, and enter The record is closed and cannot be edited.
  9. Click Save.

In this case, the request cannot be updated after reaching the Done metaphase unless the current user has Admin permission or the request was closed within the last hour.