Operation Details
Description: Returns a count of all the tasks for all of the work queues that the specified user is subscribed to. The assignee type is set to Work Queue in the SQL.
Sterotype: nsmulti
SQL
SELECT
  ta.relatedID,
  count(*)
INTO
  :workQueueID,
  :numberOfRecords 
FROM
  TaskAssignment ta 
WHERE ta.assigneeType = 'RL23' 
  AND ta.relatedID IN 
  ( 
  SELECT
    wq.workQueueID 
  FROM
    WorkQueue wq 
  WHERE wq.workQueueID IN 
    ( 
    SELECT
      workQueueID 
    FROM
      WorkQueueSubscription wqs 
    WHERE wqs.userName = :userName 
    ) 
  ) 
GROUP
  BY ta.relatedID