Skip to main content

Event Mapping Application Package

PeopleSoft has been increasingly adding new ways to modify it's software without intrusive customization. One was is Event Mapping. This allows code to be placed in a application package and change the behavior of pages. These "maps" are tied to components. 

Here's a simple example. 




1. Create a custom Application Package

From Application Designer. Go to File -> New -> Application Package


Save it and give it a name

Right click on the package and select Insert App Class
 
Give the class a name
Double click to enter PeopleCode Editor


Create a class the extends PT_RCF:ServiceInterface
An application class for event mapping must import and extend the PT_RCF:ServiceInterface class. In addition, it must define a single method named execute.

In this example the class is named make_links_clickable

import PT_RCF:*;

class make_links_clickable extends PT_RCF:ServiceInterface

   method execute();

end-class;

Now create the method


method execute
   /+ Extends/implements PT_RCF:ServiceInterface.execute +/
   
end-method;

Code the method to make link editable.

method execute
   /+ Extends/implements PT_RCF:ServiceInterface.execute +/
   VNDR_MAINT_WRK.DCP_URL_PB.Enabled = True;
end-method;

Notice that we are accessing the component buffer here in the application package. We can do this because we'll be assigning this package to the component. 

Step 2: Create a Related Content Service

From PeopleSoft
PeopleTools -> Portal -> Related Content Service -> Define Related Content Service

Click Add a New Value and give it a name





Chose URL type Application Class


Select the Application Package and Class Created




Step 3: Map Related Content Service to Component Event

PeopleTools -> Portal -> Related Content Service -> Manage Related Content Service 

Select Event Mapping (Tab)  Click on  'Map the event of the Application pages' hyperlink



Navigate to the component where this code should execute.

Chose the event that will execute the code. 






Comments

Popular posts from this blog

PeopleSoft REST services

PeopleSoft Rest Service     Here is a step by step example of how to create a REST service in PeopleSoft.  The first example passes one row of data via the URL. The response includes multiple po lines.  The second example passes JSON in the body with no parameters in the URL. The response is one row per row in the request.   1)     Create template document for inbound parameter(s) (the request). 1)     One or more element names. 2)     Create a view record of the outbound data (the response). 3)     Create template document. 1)     Element names, Collections and Compounds. 2)     Map the document elements to fields in your view 4)     Link messages to document 5)     Create your response message which structures ...

Scanning Barcode and QR Code with JavaScript in PeopleSoft

Creating a mobile app with JavaScript is simple and common. Simply find a JavaScript Library and write the code to use it. But how do we do that with PeopleSoft This Blog will give you an example. 1st we need JavaScript Library to Scan both QR and Barcode InstaScan (only did BarCode) https://github.com/schmich/instascan Zxing (did both)  https://github.com/zxing-js/ Great libraries exist, but how do we get that into PeopleSoft? We'll need to add video/camera to Mobile Inventory Pages.  Can this be added? Will the page be able to access the camera? The answer is in PeopleSoft PeopleTools Tips & Techniques by Jim Marion Chapter 6 JavaScript for the PeopleSoft Developer JavaScript Libraries, pages 240-241 IScript/Messages Step 1 Get mimified version of Zxing https://unpkg.com/@zxing/library@0.14.2/umd/index.min.js PeopleTools -> Utilities-> Administration-Message Catalog Add Minified Code to Description Yes, you are correctly seeing that. Store the code in the message c...