Using “display” business rule and “g_scratchpad”, if the logged in user is part of “Database” group then populate Description as “Display business rule applied for Database group”.

Bavisetty Hemas
Kilo Explorer

hi

2 REPLIES 2

Musab Rasheed
Tera Sage
Tera Sage

Hi,

It is as follows. Mark my answer as correct if that helps.

Business rule.

Display Query Business rules

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

g_scratchpad.grp = gs.getUser().isMemberOf('sys_id of the group');
 
})(current, previous);

 

Client script :

if((g_scratchpad.grp.toString() == 'true'))
{
g_form.setValue('description', "Part of Database group");
}
Please hit like and mark my response as correct if that helps
Regards,
Musab

Shital Bhole1
Kilo Contributor

HI Bavisetty Hemasri,

 

You can write script like below in display BR:

g_scratchpad.description = "";

if(gs.getUser().isMemberOf('Database')){

g_scratchpad.description = "Display business rule applied for Database group";
}

 

IN Onload client script:

If(g_scratchpad.description!=""){

g_form.setValue("description","Display business rule applied for Database group");

}