Wednesday, June 6, 2012

Calling Application Engine from Page

In this method, a run control table is created. It is populated prior to scheduling the process.

Example:
   Local Record &RunControl = CreateRecord(Record.RUNCNTL_tbl);
   &RunControl.OPRID.Value = %UserId;
   &RunControl.RUN_CNTL_ID.Value = "Run_Control_ID_1";
   &RunControl.TEXT1.Value = &RunPara1;/**Run Control Parameter*/
   &RunControl.TEXT2.Value = &RunPara2;/**Run Control Parameter*/

   &RunControl.Delete();
   &RunControl.Insert();

   /* Create the ProcessRequest Object */
   Local ProcessRequest &RQST = CreateProcessRequest();

   /* Set all the Required Properties */
   &RQST.RunControlID = "RuncntID_1";
   &RQST.ProcessType = "Application Engine";
   &RQST.ProcessName = "PROGID";

   /* Schedule the Process */
   &RQST.Schedule();

   If &RQST.Status = 0 Then
      WinMessage("Process is scheduled", 0);
   End-If;

No comments:

Post a Comment