Ashar's blog

Nightly batch processes????

Guys.... In this post I'm just sharing my thoughts on nightly batch processes rather than writing any technical solution or design.

The other day we had some issues with a few of the batch processes running in our production. Some of the custom mass update processes where running for hours which slowed down the system and in turn crashing one of the app servers. Luckily we have failover app servers configured, so we didn't receive hundreds of emails and tickets logged by the end users. :-)

Compare Report in CSV or HTML format

Click here -> Compare Report in HTML format to see how you can generate compare reports in HTML or CSV format.

Compare data in different tables with same structure

Here is the SQL to compare the differences in the data in different tables with same structure. Will be helpful for comparing the data between databases. This works in MS SQL Server if both databases are on same server or if there is a linked server configured for the other database.

SELECT  * FROM
(SELECT Max(TableName) AS TableName, FIELD1, FIELD2, FIELD3
FROM (SELECT 'HRDB1..PS_MY_RECORD' AS TableName, FIELD1, FIELD2, FIELD3
FROM HRDB1..PS_MY_RECORD
UNION ALL SELECT 'HRDB2..PS_MY_RECORD' AS TableName, FIELD1, FIELD2, FIELD3
FROM HRDB2..PS_MY_RECORD ) A  

PeopleSoft Application Development

Lets start with the basics of application development in PeopleSoft. Well, I hope you all know that Application Designer is the tool which we used to develop PeopleSoft application and we usually call it as App Designer in short. Basically there are 8 steps in PeopleSoft Application Development.

Here are the 8 steps of PeopleSoft Application Development:

1. Design the application
2. Define new fields
3. Create record definitions
4. Build the records
5. Create page definition
6. Define the component
7. Registering the component
8. Test the application

Security Tables

PSOPRDEFN - UserIds created.
PSCLASSDEFN - Permission List definition.
PSROLEDEFN - Role Definition table
PSAUTHITEM - Menus, Components and Pages attached to a permission list.
PSROLEUSER - Contains user and role mapping.
PSROLECLASS - Role Permission List mapping.

PSAUTHBUSCOMP -- Component Interfaces Permissions
PSAUTHCHNLMON - Message Channels tagged to any particular PLs
PSAUTHMP - Mobile Pages tagged to a particular Permission List

PSUSERATTR
PSUSEREMAIL
PSOPRALIAS
PSOPRALIASTYPE
PSOPRALIASFIELD
PSROLECANGRANT
PSAUTHCUBE
PSAUTHOPTN
PSAUTHPRCS
PSAUTHSIGNON

PeopleSoft IDs

User Id

The User Id is the ID associated with the individual user logging onto the PeopleSoft application, via PeopleTools.Validation of this ID is performed by the PeopleTools themselves at log-in time, by virtue of verifying that a row has been defined in the PSOPRDEFN table for this ID. The row in the PSOPERDEFN table contains information pertinant to PeopleSoft internal security administration, such as the access profile defining what areas of the application this ID will have access to, and a link to the ACCESS ID (defined later) associated with the UserId.

Rowcounts in PS tables

Here is the SQL that you can use to fetch the number of rows in the PS tables in MS SQL Server database.

SET NOCOUNT ON
DECLARE @tablename VARCHAR (128)
-- Declare cursor
DECLARE TABLES CURSOR FOR
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'dbo'
AND TABLE_NAME LIKE 'PS_%'
-- Create the table
CREATE TABLE #tables (
tablet CHAR (255),
RecordCount INT)
-- Open the cursor
OPEN TABLES
-- Loop through all the tables in the database
FETCH NEXT
FROM TABLES
INTO @tablename

WHILE @@FETCH_STATUS = 0

Bypass Component Search Page

We can bypass the component search page in different ways.
1. One way is to set the key values using peoplecode and use the peoplecode function SetSearchDialogBehavior. You can write the code in the SearchInit PeopleCode. Suppose Employee Id is the only key, then the code will look like,

EMPLID = %EmployeeId;
SetSearchDialogBehavior(0);

2. There is another method of using a record with no keys as the component search record. This will also bypass the search.

Based on the requirement you can use any of the above methods.

Send Emails in SQR

Here is the piece of code you can use to send email with attachments in SQR.

BEGIN-PROCEDURE sendmail
let $subject = 'Subject of the Email Here'
let $to_list = 'email@email.com'
let $ReportID = 'G:\PeopleSoft\Reports\Report_Name.pdf'
let $alias ='Attachment File Name Alias including the file extension'
let $enter = chr(10)chr(13)