Operation Details
Description: <span lang="EN-IE" style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-IE; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">Count the number of active Legal Actions where the participant has a role.</span>
Sterotype: ns
SQL
SELECT 
COUNT(CaseHeader.caseID)

INTO
:numberOfRecords

FROM 
CaseParticipantRole,
CaseHeader
WHERE 
CaseParticipantRole.participantRoleID = :concernRoleID AND
CaseParticipantRole.caseID = CaseHeader.caseID AND
CaseHeader.caseTypeCode = :legalActionCaseTypeCode AND

CaseParticipantRole.recordStatus = :recordStatus AND
 (
CaseHeader.statusCode <> :cancelledCaseStatus AND 
CaseHeader.statusCode <> :closedCaseStatus AND 
CaseHeader.statusCode IS NOT NULL 
)