Rajender1
Mega Sage

Hello all,

Here am sharing how to validate logged in user is member of current assignment group or not in Client side  and help you to set some field values or visibility or mandatory like..

First create a Display Business Rule on the table where the assignment group is.

here use "g_scratchpad".

Script for business rule:

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

var grpusr = current.assignment_group.getDisplayValue();
g_scratchpad.member = gs.getUser().isMemberOf(grpuser);

})(current, previous);

Next create a client script on your requirement like On Load or anything.

then in client side

place below script:

if(g_scratchpad.member == true)  {

g_form.setDisplay('field name', true);

//use your code here

}

like this you can validate logged in user is member of current assignment group or not.

 

Hit Helpful when you find this article helpful 

Thanks,

Rajender

Comments
Taaha M
Tera Contributor

can you help how to check if curren towner is from approval group or not

slimgam
Tera Contributor

Hi @Rajender1

 

i want to validate the same in script include, can we use same script in script include. 

my requirement is to validate the configure item "primary sme" is part of current assignment group or not.

could you please help me.

Version history
Last update:
‎08-17-2021 12:09 AM
Updated by: