0

Prevent Entities to get inactivate by mistake

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:

  1. Mark “Active” as read-only at dictionary level.
  2. Change your scope to “GRC: Profile”.
  3. 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:

image
  • Twitter
  • LinkedIn

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.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Rafael

Leave a Reply

Your email address will not be published. Required fields are marked *