Display an info message whenever a member is added to a group manually

Prabhu9
Tera Expert

I've a requirement to a identify a particular user account whenever added to a group it should prevent the addition and throw a message. However I'm able to prevent the addition but info message is the tricky part here and I've tried client script and before BR its not happening. Would be great if receive some help here. Thank you

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Prabhu9 

before insert business rule will be on sys_user_grmember , which will have that info message

please share your BR configuration and script

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Sourabh Tarlekr
Kilo Sage

Hi @Prabhu9 

 

Make glide.ui.schedule_slushbucket_save_for_group_roles property as false on sys_properties form and then try again.

 

When this property is true, job runs in the background to add or remove users hence preventing to run the BR.

 

Please refer How to adjust granting of roles and groups for detailed description.

 

Regards,
Sourabh

maheshkhatal
Mega Sage

@Prabhu9 

      Create Before Business Rule and in the Actions tab click on check Add message and in the text area add the desired text.

See the screenshot for the reference.

br.JPG

 

Mark this response as helpful if it resolved your doubt.

Thank you,

Mahesh.

Rushi Savarkar
Kilo Sage

Hello @Prabhu9 

1. Make glide.ui.schedule_slushbucket_save_for_group_roles property as false on sys_properties form.

2. Create a before-insert Business rule on Group Member table, see below code:

(function executeRule(current, previous /*null when async*/) {

    gs.addInfoMessage("The "+ current.user.getDisplayValue() + "user has been added to the " + current.group.getDisplayValue());
})(current, previous);
3. Using the Edit button add a any user
4. You will get the info message
Result:
RushikeshSavar_0-1740029095932.png

 

If this helped, please marked it as Helpful

Thank You!

If my response helped you, please accept the solution and mark it as helpful.
Thank You!