How to restrict a record producer available for only with the groups with the parent company as ABC

Sheetal18
Tera Contributor
 
13 REPLIES 13

VaishnaviShinde
Kilo Sage

Hi @Sheetal18 

If you already have the user criteria then add that criteria to Available For related list and If you don't have user criteria to satisfy your requirement then create a new user criterion and then add to the Available For related list. Check the advance check box and add script for that user criteria.

can u help me with some code..

Sheetal18
Tera Contributor

checkUsers(gs.getUserID());
function checkUsers(user){
var Agr = new GlideRecord('sys_user_group');
Agr.addEncodedQuery("u_par_company=ABC^active=true");
Agr.query();
if(Agr.next()){
answer = true;
}
else {
answer = false;
}
return answer;
}

 

pls check above code whats wrong in this its not working

Can you elaborate your requirement? 

Also in the code declare the answer variable in function.

A record producer has to be available for , only the groups with the parent company as ABC. We have u_par_company field on group table