If logged in user is member of current assignment group then populate the alert message

vinuth v
Tera Expert

Hi All,

 

I need to populate the alert message when If logged in user is member of current assignment group.

For this I tried with the display business rule and client script,

Display business rule:

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

    // Add your code here
    g_scratchpad.sd=gs.getUser().isMemberOf(current.assignment_group);

})(current, previous);
 
Client script:
Table is incident and Type is onLoad,
function onLoad() {
   
   if(g_scratchpad.sd==true){
   alert("User is group member");
 
   }
}
But it's not working as expected.
 
Thanks in advance,
Vinuth
6 REPLIES 6

Najmuddin Mohd
Mega Sage

Hi @vinuth v ,
The code is perfect. Can you check in the client script, did you select the filed UI type to All.
Also, can you check if(g_scratchpad.sd==1) works.

If this information helps, mark this post as Helpful.
Regards,
Najmuddin.

Hi @Najmuddin Mohd,

Thank you,

 

Yes, I have select the UI type to All and I tried with your script but it's not working.

vinuthv_0-1723576519352.png

 

Thank you,

Vinuth

Hi @vinuth v ,

Can you check any conditions that you are applying in the Business rule. And, send when in the business rule is selected as Display.

Regards,
Najmuddin.

Please find the Display business rule screen shots.

vinuthv_0-1723577668645.pngvinuthv_1-1723577700950.png