Operation Details
Description: Retrieves all OutcomePlans whose nextReviewDueDate is less than or equal to the specified Date and are owned by the passed in user. The passed in statusType excludes outcomeplans with that type from being returned. The orgObjectType is used to select which orgobject that is associated with the outcomeplan should be returned, such as the user type.
Sterotype: nsmulti
SQL
SELECT 
  outcomePlanID 
INTO 
  :outcomePlanID 
FROM 
  OUTCOMEPLAN INNER JOIN CASEHEADER ON OUTCOMEPLAN.outcomePlanID = CASEHEADER.caseID 
INNER JOIN ORGOBJECTLINK ON   CASEHEADER.ownerorgobjectlinkid=ORGOBJECTLINK.orgobjectlinkid 
WHERE OUTCOMEPLAN.nextreviewduedate <= :nextReviewDueDate 
  AND ORGOBJECTLINK.username=:userName 
  AND ORGOBJECTLINK.orgobjecttype=:orgObjectType
  AND CASEHEADER.STATUSCODE<>:statusCode
  ORDER BY OUTCOMEPLAN.nextreviewduedate ASC