Below is a snippet of code showing how to initiate a process via peoplecode. This specific scenario is using the delivered record FUNCLIB_SF.PRINT_RECEIPT. It is setting up a BI Publisher process.
Note - For emailing a BI Publisher report the Process Instance can not be 0.
Peoplesoft has some delivered app classes to handle BI Publisher reports (ex: how the report is displayed - browser, email, printer, etc) which can be found in PSXP_RPTDEFNMANAGER:ReportDefn
If %Page = Page.CSH_OFF_DEPT Or
%Page = Page.CSH_RCPT_DETAIL Then
&sProcessName = "PSXPQRYRPT";
End-If;
&sRunCntlid = "PRINT_RECEIPT";
&sProcessType = "XML Publisher";
&RQST = CreateProcessRequest();
&RQST.ProcessType = &sProcessType;
&RQST.ProcessName = &sProcessName;
&RQST.RunControlID = &sRunCntlid;
&RQST.RunLocation = "SERVER";
&RQST.OutDestType = "6";
&RQST.OutDestFormat = "2";
&RQST.RunDateTime = %Datetime;
&RQST.TimeZone = %ServerTimeZone;
If &EmailDept = "Y" And
&EmailReceipt Then
&RQST.OutDestType = "5";
&RQST.OutDestFormat = "2";
&RQST.OutDest = &EmailID; /*&EmailID;*/
&RQST.EmailSubject = "BI Publisher Report";
&RQST.EmailText = "BI Publisher Report";
End-If;
&RQST.Schedule();
&iProcessStatus = &RQST.Status;
................
................
If SetBIPublisherProcess(&sBIPubStat) = True Then
rem Exit (0);
.................
.................
Function SetBIPublisherProcess(&sBIPubStat As string) Returns boolean;
Local SSF_CASHIERING:PrintReceipt:ReportingContext &RptContext = create SSF_CASHIERING:PrintReceipt:ReportingContext();
Local SSF_CASHIERING:PrintReceipt:BIPubReport &BIPubReport = create SSF_CASHIERING:PrintReceipt:BIPubReport( False);
Local string &sBindRecordName = "%Table(RUN_CNTL_SF)";
Local string &sPromptRecName = "Record.PSCONQRSRUNPRMX";
Local Record &RecRunCntlSF = CreateRecord(Record.RUN_CNTL_SF);
Local array of array of string &aFldBindNames;
&aFldBindNames = CreateArray(CreateArray("BUSINESS_UNIT", "CASHIER_OFFICE", "RECEIPT_NBR", "OPRID", "RUN_CNTL_ID"));
&aFldBindNames.Push(CreateArray("BUSINESS_UNIT", "CASHIER_OFFICE", "RECEIPT_NBR", "OPRID", "RUN_CNTL_ID"));
rem Update Bind Record(RUN_CNTL_SF);
&RecRunCntlSF.OPRID.Value = %UserId;
&RecRunCntlSF.RUN_CNTL_ID.Value = &sRunCntlid;
&RecRunCntlSF.BUSINESS_UNIT.Value = &sBusinessUnit;
&RecRunCntlSF.CASHIER_OFFICE.Value = &sCashierOffice;
&RecRunCntlSF.RECEIPT_NBR.Value = &iReceiptNbr;
&RecRunCntlSF.Delete();
&RecRunCntlSF.Insert();
Evaluate CSH_OFF_RECEIPT.CO_TRANS_TYPE.Value
When "03"
rem Departmental Receipt;
&sReportDefinition = "SF750R_DRCPT";
&sReportTemplateDef = "SF750R_DRCPT_1";
Break;
When-Other;
Break;
End-Evaluate;
&RptContext.RunControlId = &sRunCntlid;
&RptContext.ProcessInstance = &RQST.ProcessInstance;
&RptContext.PromptRec = &sPromptRecName;
&RptContext.ReportName = &sReportDefinition;
&RptContext.TemplateId = &sReportTemplateDef;
&RptContext.LanguageCd = "";
&RptContext.AsOfDate = %Date;
&RptContext.CQName = "SF750R_BI_CSH_OFF_RCPT_PRINT";
&RptContext.OutDestFormat = 2;
&RptContext.OutDestType = &nOutDestType;
&RptContext.OutDestPrinter = &sOutDestPrinter;
&RptContext.FldBindNames = &aFldBindNames;
&RptContext.BindRecordName = &sBindRecordName;
If &BIPubReport.GenerateReceipt(&RptContext) = True Then
Return True;
Else
Return False;
End-If;
End-Function;
Showing posts with label process scheduler. Show all posts
Showing posts with label process scheduler. Show all posts
Tuesday, May 2, 2017
Monday, February 6, 2017
Did you try clearing cache?
Aside from browser cache, Peoplesoft has 3 types of cache that can cause issues with performance.
If you are having issues with how you are expecting the functionality to behave and you have verified that your updated code is in the desired environment then try clearing the related options listed.
Process Scheduler cache relates to app engine code, sql and sections along with component interface code. Other processes like SQRs and COBOL don't use cache.
App Server cache relates to code ran in the web browser such as peoplecode, pages and components. It also needs to be cleared after upgrades and bundle applications.
Webserver cache usually needs to be ran after a bundle application, upgrade, patches. Also sometimes you will not see content references or folders that have been migrated. Assuming you have the necessary security to view them, you may need to clear the webserver cache.
If you are having issues with how you are expecting the functionality to behave and you have verified that your updated code is in the desired environment then try clearing the related options listed.
Process Scheduler cache relates to app engine code, sql and sections along with component interface code. Other processes like SQRs and COBOL don't use cache.
App Server cache relates to code ran in the web browser such as peoplecode, pages and components. It also needs to be cleared after upgrades and bundle applications.
Webserver cache usually needs to be ran after a bundle application, upgrade, patches. Also sometimes you will not see content references or folders that have been migrated. Assuming you have the necessary security to view them, you may need to clear the webserver cache.
Subscribe to:
Posts (Atom)