Lock cases
Occasionally you may want to lock a case to prevent changes from being made to the case data. When you lock a case, users can still view the case detail from pages and views, but they cannot edit the attribute values, perform casetype activities to create related cases, close or reopen the case, or trigger any other activities.
Locking a case can be useful when investigating an issue or performing an audit, for example. In these situations you may want to freeze the case as it is while you gather the evidence you need. When you have finished, you can unlock the case so that users can continue to interact with it as normal.
When a case is locked:
- Any existing mandatory tasks or optional activities on the case become unavailable (but are not cancelled).
- If an activity on another case triggers an activity on the locked case, the latter activity is automatically cancelled.
- Any deadline, timed event, or queued task activities that become due while the case is locked are automatically cancelled.
- The values of any cached computed attributes on the case are not updated (unless you use the "power edit" option in Developer Tools to edit the value of a source attribute on the same case).
- You cannot recalculate the case from Developer Tools.
- Users with access to Developer Tools can use "power edit" to edit individual attribute values without unlocking the case first. For more information, see Debug your application.
Create an activity to lock cases
To lock cases, add a Lock case activity to the casetype:
- Open the casetype, select the Activities tab, and add a new activity.
- From the Type picklist select Process block.
- From the Process block type select:
- Lock case to lock the case without changing the state. This option is available for all casetypes.
- Close and lock case to close the case and then lock it. Closing a case also cancels any open tasks and progresses the parent casetype activity to the
When donestage. This option is not available for page casetypes.
- Enter other activity details as required and then create the activity.
You can add triggers and mappings to the On trigger stage of the Lock case activity. You cannot add rules to the When done stage as the case will already by locked (and therefore you cannot perform activities on it).
You can grant rights to perform the activity as normal, or add a trigger to another activity to perform the Lock case activity automatically. Alternatively, if you only want to perform this type of activity from Developer Tools, you do not need to grant rights or add a trigger.
Whether a case is locked is recorded in the case metadata. You can access this data using the casemeta. inline template function and use it when adding conditional logic to an activity or when displaying content on a view.
Unlock a case
When you unlock a case, any existing activities on that case become available once more (unless you also closed the case). This means that users can edit attribute values (via form activities), other activities can trigger activities on the case, and any cached computed attributes are recalculated whenever an activity is performed on the case.
Unlocking a closed case does not reopen it. To reopen a case, perform a Reopen case activity. For more information, see Close cases.