+ Start a Discussion
sai.sfsai.sf 

Current user

Hi All,

 

If current user is belongs to queue of the record or not else throws alert  in javascript..How to determine current user !=Queueof record in javascript.I am using this Js in custom button

 

 

Thanks

 

 

kiranmutturukiranmutturu

try this in the script code..

 

var userid = "{!$User.Id}";
var currentrecordqueue = "{!Account.OwnerId}";
var result = sforce.connection.query("SELECT GroupId, Id, UserOrGroupId FROM GroupMember where UserOrGroupId =' " + userid + " ' + and GroupId=' "+currentrecordqueue +" ' ");

if(result.size() <= 0)
alert("Not an user from the record queue");