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
Brian CherryBrian Cherry 

Assigning cases when users login

We have several queues set-up and we would like cases to be assigned from these queues when the user logins. Login flows from what I can see doesn't limit the amount of records to update based on critera. Anyone have any thoughts?

Thanks,
Brian
SonamSonam (Salesforce Developers) 
Brian, there is a field in the User Object: LastLoginDate(data type :dateTime) using which you can check if the user is logged in or not by comparing it to the current date/time.

You can write a trigger on case object to assign this case to a Queue and check of the lastlogindate for the members in the queue(https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_group.htm)and then make the assignment accordingly.