PeopleSoft Testing - Catch CreateProcessRequest error
I'm currently conducting component testing right now and one of the test conditions is to catch the error of CreateProcessRequest. I have this code:
/define run control parameters – see code below/
Local ProcessRequest &RQST;
&RUN_PO_BU = PO_HDR.BUSINESS_UNIT;
&RUN_PO_ID = PO_HDR.PO_ID;
&RUN_OPRID = PO_PNLS_WRK.OPRID;
&RunCntlID = "PS_PO_" | &RUN_PO_BU | &RUN_PO_ID | "_" | UniqueRunCntlID();
&MI_SQRProcess = "Test";
&RQST = CreateProcessRequest("SQR Process", &MI_SQRProcess);
&RQST.RunControlID = &RunCntlID;
&RQST.Schedule();
&instanceList = &RQST.ProcessInstance;
If &RQST.Status = 0 Then
<do something>;Else
Error MsgGet(99999, 99999, "%1 process with instance %2 returned a non->zero exit code(%3)", &MI_SQRProcess, &instanceList, &RQST.Status);