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
Abhi CharlesAbhi Charles 

To get List of available user

Hi,

 

I am looking for a code where i can get the list or available user to whom i can assign task.

For example i have a task "Ticket" to be assigned so need to get list of all the user who are available at that time according to availability on the user's calendar.

Any help is highly appreciated.

 

Thanks,

AKC

 

Best Answer chosen by Admin (Salesforce Developers) 
mast0rmast0r

Try this:

 

List<Event> freeUsers = [Select OwnerId
                         From Event
                         Where ShowAs = 'Free'
                         And StartDateTime >= today
                         And EndDateTime < today];