You need to sign in to do that
Don't have an account?
vishesh91
find userId which has waited most since their last case assignment
hi all
I want to find userId which has waited most since their last case assignment,how to do it in apex.
Any help will be much appreciated
The Round Robin Assignment article in the standard Help might offer you a reasonable solution. You might consider it if only because statistically speaking, Round Robin, even if it misses (say, if not every record is assigned because of business logic), the distribution of cases would be relatively even. If you absolutely need a pecking order, I would say you'd probably want to run some sort of aggregate query against CaseHistory, grouping by user and MIN(Date), and filtering to find entries that are ownerAssignment entries.