function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

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







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");