Tuesday, November 2, 2010

PeopleSoft - JavaScript Insertion

This doodle will help you in understanding how we can display Non-PeopleSoft dialog window to the user.I will explain the steps with a sample requirement. On clicking a button, a new page with disclaimer message has to be displayed to the user.We won't use the PeopleSoft standard OK button or secondary page buttons to achieve this instead we will have a popup OK button that opens on the top of the PeopleSoft page.

1) Create a HTML definition (eg : OK_BUTTON_HTML) with the required Javascript to meet your requirement. For our example below script displays a alert dialog window with message and Ok button.On clicking Ok we will close the PeopleSoft window that displays the disclaimer message.


2) Place a HTML object and edit box in level 0 on the PeopleSoft page. Map both the objects to the same record and field. For our example we will use DERIVED_HR record's APPROVE_BTN field.

3) In the page activate place the below code

DERIVED_HR.APPROVE_BTN.Value = GetHTMLText(HTML.OK_BUTTON_HTML);

Above PeopleCode will invoke the java script that was included in the HTML dehinition OK_BUTTON_HTML. In our case alert dialog window with message and Ok button will be displayed on top of our PeopleSoft page.

This logic can be used for invoking Java scripts on the PeopleSoft pages.

No comments:

Post a Comment