Operation Details
Description: Returns a list of summary details for active and pending task redirection or task allocation blocking records for the specified toUserName.
Sterotype: nsmulti
SQL
SELECT
  tr.taskRedirectionID,
  tr.blockTaskAllocation,
  tr.startDateTime,
  tr.endDateTime,
  tr.fromUserName,
  tr.toUserName,
  tr.toRedirectID,
  tr.toRedirectType
INTO
  :taskRedirectionID,
  :blockTaskAllocation,
  :startDateTime,
  :endDateTime,
  :fromUserName,
  :toUserName,
  :toRedirectID,
  :toRedirectType 
FROM
  TaskRedirection tr 
WHERE tr.toUserName = :toUserName 
  AND 
  (
    
    (
      :startDateTime >= tr.startDateTime 
      AND :startDateTime <= tr.endDateTime 
    ) 
    OR 
    (
      :endDateTime >= tr.startDateTime 
      AND :endDateTime <= tr.endDateTime 
    ) 
    OR 
    (
      :startDateTime < tr.startDateTime 
      AND :endDateTime > tr.endDateTime 
    ) 
    OR 
    (
      
      (
        :endDateTimeIsNull = '1' 
      ) 
      AND 
      (
        
        (
          tr.endDateTime > :startDateTime 
        ) 
        OR 
        (
          tr.endDateTime IS NULL 
        ) 
      ) 
    ) 
    OR 
    (
      
      (
        tr.endDateTime IS NULL 
      ) 
      AND 
      (
        :endDateTime > tr.startDateTime 
      ) 
    ) 
  )