Thursday, 13 February 2014

Generate XML Report using Peoplecode



Generate XML Report using Peoplecode (PSQUERY as Data Source)

  • Import Report definition manager Application classe.
  • Create a new report definition object using the XML Publisher Report ID.
  • Call the Process Request method using the Template ID.
  • Display the generated output report.

Report File Generation Sample: 

import PSXP_RPTDEFNMANAGER:ReportDefn;

Local PSXP_RPTDEFNMANAGER:ReportDefn &oRptDefn;
Local string &ReportId = "MYXML_RPT";
Local string &TemplateId = "MYXML_TMPL";

&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&ReportId);
&oRptDefn.Get();
&rcdQryPrompts = &oRptDefn.GetPSQueryPromptRecord();
If Not &rcdQryPrompts = Null Then
         Rem &rcdQryPrompts.EMPLID.Value = “XYZ”;
               &oRptDefn.SetPSQueryPromptRecord(&rcdQryPrompts);
End-If;
&sOutDestFormat = &oRptDefn.GetDefaultOutputFormat();
 
&oRptDefn.ProcessReport(&TemplateId, "", %Date, &sOutDestFormat);
CommitWork();
&oRptDefn.DisplayOutput();

Friday, 20 July 2012

Dynamic Prompt Table

We can accomplish dynamic prompt table in 2 ways:
  1. Using EDITTABLE fields for Prompt Table.
  2. Using Dynamic Views.


1. USING EDITTABLE FIELDS:

In this method, Prompt table property of Record Fields should be assigned with %EDITTABLE value.

Let’s take an example to understand this. If want to assign dynamic prompt to our Record Field EMPLID. In this case in Record Field Property under Edit tab edit should be prompt table and value should be %EDITTABLE.

Now put the field DERIVED.EDITTABLE on the page and make it hidden. The Prompt Table value for the Record Field is populated from the Record Field DERIVED.EDITTABLE value. The Record Field DERIVED.EDITTABLE should be assigned with value either in one of the Peoplecode events (Either in FieldChange or FieldEdit or RowInit events). This is simply done by:

DERIVED.EDITTABLE = "EMPLOYEES";

Note: EDITTABLE Field should be present in the SAME Page, where the Record Field (In this case, The Field is EMPLID) is.

2. USING DYNAMIC VIEWS:

As we know, while creating Dynamic view, there is no need to specify the SQL. This SQL should be written and assigned to the Record Field dynamically using Peoplecode.

For example Record Field EMPLID, it is assigned with dynamic prompt table view EXAMPLE_DVW and this view EXAMPLE_DVW is dynamically initialized by the following Peoplecode, which can be assigned both in FieldChange and RowInit events of the Record Field EMPLID:

<RECORDNAME>.EMPLID.SqlText = "<write your SQL here>";

Note: One interesting fact about dynamic views is that you can change its output on page considering some factors like User permissions, other key field values on page etc.


Creating Content Reference for External Site

You may create a content reference in the portal that opens an external site.


Thursday, 19 July 2012

Create Portal Registry Content Reference for a Query

You can easily create a new Content Reference for running the Query directly from Left hand menu, without navigating thru Query viewer. This allows easy execution of query by end user.

Go to Structure and Content and Create a new Content reference, with following properties

Usage Type : Target
Select No Template check box.
Node Type : Always use Local, if you want to run the query hosted locally
URL Type : PeopleSoft Generic URL
Portal URL : q/?ICAction=ICQryNameURL=PUBLIC.
<MYQUERYNAME>
Note : No forward slash before q. Otherwise Portal template will not be removed.
Content Reference Attributes
Name : NAVNEWWIN
Attribute Value : true
Uncheck Translate check box.

This will open the query page in a new window with no Portal wrapper.

If you want to pass parameters to query URL, you need to add the following at the end
"&<unique prompt name>=<value>"

You can find the unique prompt name from prompt definition page.

Implementing CAPTCHA using ReCaptcha in PeopleSoft



You can use this for the forgot password component , carrer login page (applicant login) or any other similar pages strighat way.
Following are modified steps from the reCAPTCHA website for the PeopleSoft Implementation.

First, go to
 the reCAPTCHA web site and create an account. As part of that account creation process you'll have to specify the domain your reCAPTCHA will be protecting. The reCAPTCHA site will will give you a key pair for that domain. The key pair allows you to authenticate your reCAPTCHA requests to the reCAPTCHA servers

Second, Create the HTML Area in the PeopleSoft page where you want the ReCaptcha to apper
in the HTML Defination add the follwing Java script code, you need to enclose it with form tags.
make sure you replace
   - with the public key from the key pair created in reCaptcha website.



Download the Java API library in the following location
 

http://code.google.com/p/recaptcha/downloads/list?q=label:java-Latest - Place the jar file in the class path/folder for the java in the appserver.

Add button on the page, similar to submit button for the page, on field change of the button you can write the code as below.
PS: Make sure you replace the private in code with the private key generated by reCaptcha for your domain.
Hope this will be helpfull.

AWE Workflow - Escalation emails

Peoplesoft AWE Workflows - Escalation process

AWE Workflows
 

In the “setup process definition“ you define the timeout for escalation. The ESCALATIONS Event ID will make sure to escalate if not approved within the “timeout” period.


PTAF_NEM - Is the process that needs to be run for the escalations in the approval workflow.

The PTAF_NEM process, when run kicks off 3 application engine programs one for each of the following events ID

Approval Activity Email
Receipt Notifications
Escalations

The AWE Notification & Escalation process, PTAF_NEM, only sends out one ( 1 ) notification, however, multiple actions can be performed at each timeout. i.e. Notify and Reassign after 2 hours. Or Notify after 1 hour and Notify and Advance after 24 hours.

What cannot be done is to set the Timeout to 1 hour and expect to get a notification every hour that an action has not been taken.


EMP_SERVLET - URL needs to be configured to send the correct url link in the escalation notification emails.