
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-03-2021 02:44 AM
Hi all,
I had few incidents in the past when entities get inactivated by mistake so I decided to leverage our entity management and improve UX to allow them (managers) to receive a popup message before they proceed with inactivation of an entity
Steps:
- Mark "Active" as read-only at dictionary level.
- Change your scope to "GRC: Profile".
- Go to Profile [sn_grc_profile] and create a UI action called "Mark as inactive" with the following conditions:
Name: Mark as inactive
Action name: entity_retire
Form button: true
Show insert: true
Show update: true
Form style: destructive
List style: destructive
Client: true
Onclick: confirmAndRetireEntity()
Condition: gs.getUser().hasRole('sn_grc.manager') && current.active == true
Script:
function confirmAndRetireEntity() { var gwt = new GwtMessage(); var title = gwt.getMessage('When a entity is retired, all related risks and controls are retired. Are you sure you want to continue?'); var modal = new GlideModal("sn_grc_retire_popup", false, 600, 450); modal.setTitle(gwt.getMessage('Confirmation')); modal.setPreference('sysparm_title', title); modal.setPreference('sysparm_sysid', g_form.getUniqueValue()); modal.setBackdropStatic(true); modal.setPreference('focusTrap', true); modal.setPreference('action_name', 'entity_retire'); modal.render(); return false; } if (typeof window == 'undefined') updateStatus(); function updateStatus() { current.setValue('active', 'false'); current.update(); action.setRedirectURL(current); }
Result:
Note:
1. This pop up can be widely used (its generic) but it was originally created for Policies.
2. You need to create another button called "Mark as active" to perform the opposite behavior of this UI action. I gave "entity_enroll" as action name, change condition to run only on inactive records, change function name "confirmAndEnrollEntity()", change line to "current.setValue('active','true')" and thats it.
- 637 Views