Operation Details
Description: Count the number of cases for each statusCode, for example, 'Open', 'Active' etc
Sterotype: nsmulti
SQL
SELECT
  COUNT(*),
  CaseHeader.statusCode
INTO
  :numberOfRecords,
  :statusCode 
FROM
  CaseHeader,
  CaseUserRole,
  OrgObjectLink 
WHERE OrgObjectLink.userName = :userName 
  AND OrgObjectLink.orgObjectLinkID = CaseUserRole.orgObjectLinkID 
  AND CaseUserRole.caseID = CaseHeader.caseID 
  AND CaseUserRole.typeCode = :typeCode 
GROUP
  BY CaseHeader.statusCode