How do I permit users to remove requests?
With most business systems, it is best to never delete requests, but instead have them cancelled, and then optionally hidden to effectively delete them from the end-users view (as such, to the average user they are deleted, but an administrator never loses any data that might be needed for security or other tracking needs). After a data retention period has passed, the Cancelled (deleted) requests can be purged in batch.
The method to do this hides the request from the grid view by:
- Adding a hidden Boolean field "Cancelled" to all requests
- Leveraging a workflow action named "Cancel" to set the Cancelled field to True
- Setting the column filter for the Cancelled field to contain "false", so only those records that have not been Cancelled will be shown
Step-by-step guide
- To begin we need declare a hidden Boolean field.
- Select Module in the top left banner then select the appropriate module name link.
- Select the Forms tab then select the Field List button "Create/Update Fields".
- Using the search filter in the upper left type "customBool".
- Select the Edit pencil icon on one of the Boolean fields that is not being used.
- Type "Cancelled" into the Name field, enable Hide in form, and clear the text within the Column Header field.
- Select "Update", and then Save in the upper right.
(Copy or write down the Internal Name of the variable selected, as it will be needed later.) - Then we need to add the Boolean field we defined in the Field List to the form.
- Select Module in the top left banner then select the appropriate module name link.
- Select the Forms tab then select the name link.
- Select the drop down to the right of Palette, and select Check.
- Drag and Drop the Cancelled Boolean field from the Palette on the right to the form Canvas on the left.
(This adds the hidden Boolean field to the form, requests, and grid view.) - Select Save in the upper right.
- Next we must define the action, state, and sub-action.
- Select Module in the top left banner then select the appropriate module name link.
- Now within the module properties select the Workflows tab then select the appropriate workflow name link.
- Select Next.
- Select +Add in the upper left.
- Type "Cancelled" into the action Name field.
- Set the Step Type to "Finish", then select OK.
- Select Next.
- Select +Add in the upper right.
- Type "Cancel" into the Name and Display Name fields.
- Select the Start states drop down, and select the action states you would like the Cancel action to be available on.
- Select the End states drop down, and select Cancelled.
- Select the Permissions tab, and enable access to the action based on the Roles here.
(Only enabling permission to the Admins, and not any of the defined User roles would reserve the action to only be performed by Administrators.) - Select the Subactions tab, and click on the blue box to add a new sub-action.
- Paste if copied from step five above, or type "customBool#" into the Field on the left, and type "true" in the Value on the right.
(The name of the Boolean variable will vary depending on the Internal Name of the Boolean field you selected to define as "Cancelled" within the Field List.)
(There should be an "=" sign in between the Field and the Value.) - Select OK, then select Save.
- Return to the grid view type "false" into the text filter under the Cancelled column field.
- Now set the view to not show the Cancelled field by selecting the grid filter in the upper right and un-checking it within the drop down by selecting "Cancelled".
- Lastly, it is important that this configuration of the text filter under the Cancelled column field, and hiding of the column in the grid filter be Saved into the Layouts to function properly.
- This is done by selecting the View drop down in the upper right, then Save Layout.
- Once Configured the Cancel action is only available to those states as it was defined to be in the workflow.
- To take a request out of this Cancelled state an action would need to be defined in the workflow as available on this Cancelled state with a resulting previous state, and with a sub-action inversely setting the Cancelled field of the request back to the default "false" value.
- You are able to set the text filter under the Cancelled field column to "true" to view only the those records which have been Cancelled.
- The action, resulting state, and field names are not reserved terms and may all be customized as the Administrator sees fit.
Related articles