Code to know whether the Scheduled App Engine ran to success or not

Your rating: None Average: 2.8 (6 votes)

If &MYRQST.Status = 0 Then /* if Schedule status is success */

&LOOP = 0;
While &LOOP = 0
SQLExec("SELECT A.DISTSTATUS, A.RUNSTATUSDESCR FROM PS_PMN_PRCSLIST A WHERE A.PRCSNAME = :1 AND A.PRCSINSTANCE = (SELECT MAX(B.PRCSINSTANCE) FROM PS_PMN_PRCSLIST B WHERE B.PRCSNAME = A.PRCSNAME)", &MyAppName, &POSTED, &STATUS);

If &STATUS = "Success" And
&POSTED = 5 Then /* Posted */
&LOOP = 1
End-If;

If &STATUS = "Success" And /* Not Posted */
&POSTED = 4 Then
&LOOP = 2
End-If;

If &STATUS = "No Success" Or
&STATUS = "Error" Then
&LOOP = 3;
End-If;

End-While;

If &LOOP = 1 Then
MessageBox(0, "", 27333, 594, ""); /* Success Msg */
Else
If &LOOP = 2 Or
&LOOP = 3 Then
MessageBox(0, "", 27333, 595, ""); /* Failed Error Msg */
End-If;
End-If; /* If &LOOP = 1 Then */
End-If; /* If &MYRQST.Status = 0 Then */

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!