The CreatorCon Call for Content is officially open! Get started here.

Setting VIP for members of a group

Wayne Richmond
Tera Guru

Hey. I'm trying to create a Business Rule that will set vip to true for users who are added to a particular group. I tried creating the BR on the sys_user_grmember table as follows:

find_real_file.png

find_real_file.png

I expected that when I added a user to that group (and thus a sys_user_grmember record was created), the user would get vip status, however this isn't working. Any ideas? I didn't wonder if the Action condition doesn't like dot walking to the vip field on the sys_user table.

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

Looks like to update the dotwalking field you need scripting, I also tried but wasn't able to update though i can change the direct field value like user in sys_user_grmember table and was able to print the message.

 

find_real_file.png

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sys_user');
gr.get(current.user);
gr.vip = true;
gr.update();
})(current, previous);

View solution in original post

2 REPLIES 2

Shishir Srivast
Mega Sage

Looks like to update the dotwalking field you need scripting, I also tried but wasn't able to update though i can change the direct field value like user in sys_user_grmember table and was able to print the message.

 

find_real_file.png

 

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sys_user');
gr.get(current.user);
gr.vip = true;
gr.update();
})(current, previous);

Thanks for confirming that and providing the script, Shishir, it worked perfectly. I tried scripting it myself but without using GlideRecord.