Wednesday, October 24, 2012

Tablespace Script

Script to update the Tablespace for all the records in the Project.

 
Script to update the Tablespace for all the records in the Project. when we import Project in the client instance, we can use this SQL to change the tablespace for all the records at time, rather changing it one by one.

Update PSRECTBLSPC
SET DDLSPACENAME = {NEW TABLESPACE}
WHERE DDLSPACENAME = {OLD TABLESPACE};
and RECNAME IN (Select A.OBJECTVALUE1 from PSPROJECTITEM A, PSRECDEFN B
               Where A.PROJECTNAME = {PROJECTNAME} and A.OBJECTTYPE = 0 and A.OBJECTID1 = 1 and A.OBJECTVALUE1 = B.RECNAME and B.RECTYPE =0)

Peoplesoft HCM9.1 Upgarde -  

1. Date Time Stamp Issues- OracleDescriptor=1 or Cast or To_date or To_Char

2. Funclib_absence Record is converted to Funclib_gp_abs

3. Grou_id configuration issue-for current Calender Group - onebrace is coming extra.

4. Style Sheet - new style sheet is PSSTYLEDEF_SWAN

Peoplesoft - HR & Base Benefits


Primary Jobs in Peoplesoft
There are 2 types of the Primary Jobs in the Peoplesoft HCM
1) HR - Primary Job Indicator in the Job data component.
2) Benefits - Primary Job Indicator.
One of the Employee job will be considered as the HR -Primary job for an employee and this is mainly for reporting purpose.

One of the Employee Job will be considered as the Benefits - Primary Job for Jobs under particulary Benefit Record number of an employee. If employees' Jobs are assigned to more than one Benefit record number and for each set of the Employees' Jobs under the particular Benefit record number one Benefits Primary Job should be selected.

Job - Data - Benefit Program Participation Page can be used to set the Benefit Record number.

Note : - Benefit Record Number is Zero by default. You manually change this field when appropraite. Because you are maintaning an effective-dated history of primary jobs benefits according to a set of strict rules , don't change the benefit record number of an existing job.
Doing so invalidates the primary job inicators that reside on the effective - dated primary jobs table and can result in erroneous processing within Benefits Adminstration and payroll for north america, resulting in abnormal termination of some processes.

Multiple Job Options can be set in the below Component.
Setup HRMS > Product Releated > Base Benefits > Multiple Job Options > Mutliple- Job optns

Following page can be used to view and update an employee's primary Job flag inculde deduction flag.
Benefits > Maintain Primary Jobs > Maintain Flags > Primary Jobs Flags

Primary Jobs table, Which is automatically created when ever a job is added using the Add concurrent Job pages updated whenever the job is terminated, based upon rules that you define in the multiple- Job optns (multiple Job options) page.

Primary Jobs table has following flags as well.
Include Eligibility : For Benefits Administration only. Select this check box if you want this job to be included by the system when determining the employee’s benefit eligibility.
Include Deductions: Select this check box if you want this job to be included when the system calculates the employee’s benefit deduction and coverage.

Why Benefits Primary Job is requried.
1) Determine to which Job the system applies the benefit deducation.
2) Identify the job that will provide the service date and the termination date.
3) Search record on all the Benefits search page shows only the jobs which has primary job flag is selected.

Automatically Building Primary Job Data for Multiple Employees
Run the Primary Job Utility process whenever you add a new employee population to the database through an external interface or database load (such as when implementing employee groups in phases or acquiring another company).

Benefits > Maintain Primary Jobs > Rebuild Primary Job Flags > Primary Job Maint
Process Name :- BN_BEN500_AE
When the utility runs, all existing data for the indicated employee population (if any) in the Primary Jobs Table is deleted. For each employee, a new effective-dated entry is made, assigning the primary job designation to the lowest active employee record within a benefit record number. Primary Job information is created for a time span bounded by the earliest and latest job effective dates for all jobs within a benefit record. If all jobs within a benefit record are terminated, the job with the lowest employee record is designated as the primary job.
Warning! All manual changes made through the Primary Jobs Flags page for the selected employee population are lost, because the complete Primary Job history is rebuilt for each employee.

Saturday, April 28, 2012

Send Email with Color..

send emails with colours, tables and graphics, you have come to the right place. This post explains how to send html emails from peoplecode using the html option in sendmail. This can generate really good looking emails that stand out from the usual text only emails used for notifications. So here’s how we do it.
Local string &NL = "<br>"; /* The new line character in html */
/* Setting the parameters for sendmail */
&MAIL_FLAGS = 0;
&MAIL_TO = "email1@psoftsearch.com";
&MAIL_CC = "email2@psoftsearch.com";
&MAIL_BCC = "email3@psoftsearch.com";
&MAIL_SUBJECT = "Test Email";
&MAIL_FILES = "";
&MAIL_TITLES = "";

/* Making the email body */
&GREET = "<font face ="Arial">Dear " | &f_name | " " | &l_name | "," | &NL;
&MAIL_TEXT1 = "This is a test email that contains an HTML table." | &NL;
&MAIL_TEXT2 = "<table border='1'><tr bgcolor = '#AAAAAA' ><th>Name</th><th>State</th><th>Country</th></tr><tr><td>Rojer Alex</td><td>VA</td><td>USA</td></tr></table>" | &NL;
&TEXT1 = "Your footer line(s) goes here." | &NL | &NL;
&TEXT2 = "Regards," | &NL | "The PSoftSearch team";
&MAIL_FOOTER = &TEXT1 | &TEXT2 | "</font>";
&MAIL_TEXT_BODY = &MAIL_GREET | &MAIL_TEXT1 | &MAIL_TEXT2 | &MAIL_FOOTER;

/* Sending the email */
&RET_CODE = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_TEXT_BODY, &MAIL_FILES, &MAIL_TITLES, "", ";", "Content-type: text/html; charset=utf8");

/* Evaluating the return value of sendmail and showing the appropriate message */
If (&RET_CODE = 0) Then
MessageBox(0, "Alert", 0, 0, "Email has been sent.");
Else
MessageBox(0, "Alert", 0, 0, "Unable to send email.");
End-If;

Populating Data into Grid...

we would see how to populate a Grid dynamically using PeopleCode. Here we use a Dynamic View SGK_VCHR_DVW as the main record of the Grid.
The grid is placed on level 1 of a secondary page and is populated using Peoplecode written in the Activate event of the secondary page. We use the SQL object &VCHRS_GRD_SQL to fetch some Voucher IDs and Vendor IDs from the database and populate the grid with these values.
Local SQL &VCHRS_GRD_SQL;
/* SQL object for fetching the vouchers and vendors*/
Local Rowset &VCHRS_GRD_RS;
/*Rowset for accessing the Grid*/


&VCHRS_GRD_SQL = CreateSQL("SELECT V.VOUCHER_ID, V.VENDOR_ID FROM PS_VOUCHER V WHERE V.BUSINESS_UNIT =:1 AND V.ACCOUNTING_DT>:2", &SGK_BU, &SGK_ACCTG_DT);
/*creating the SQL statement*/


&VCHRS_GRD_RS = GetLevel0()(1).GetRowset(Scroll.SGK_VCHR_DVW);
/*creating a rowset corresponding to the grid */

While &VCHRS_GRD_SQL.Fetch(&GRD_VOUCHER_ID, &GRD_VENDOR_ID)
&VCHRS_GRD_RS(1).SGK_VCHR_DVW.VOUCHER_ID.Value = &GRD_VOUCHER_ID;
/*assigning the voucher ID to the filed in the grid */
&VCHRS_GRD_RS(1).SGK_VCHR_DVW.VENDOR_ID.Value = &GRD_VENDOR_ID;
assigning the Vendor ID to the filed in the grid
&VCHRS_GRD_RS.InsertRow(0);
/* inserting a new row at the beginning of the grid*/
End-While;

&VCHRS_GRD_RS.DeleteRow(1);
/* deleting the empty row left after all the insertions */
&VCHRS_GRD_SQL.Close();
/* closing the SQL object */
PeopleSoft Component Interface (CI) exposes a PeopleSoft Component for synchronous access to other applications written in PeopleCode, Java or C++. We can consider CI as the means by which PeopleSoft enforces encapsulation by limiting external access to just what is made available through the CI and nothing more.
A CI also executes the business logic included in the Component. As such, it provides a higher level of data validation to the data that is being loaded into the Component when compared to direct SQL inserts.
PeopleSoft also provides a Component Interface Tester to validate the CI and Excel To CI to manage loading data.
You can have as many CIs pointing to a Component as you want. But a Component Interface can point to only one Component.
Attributes of a Component Interface
A Component Interface has the following five attributes.
  • Name
  • Keys
  • Properties
  • Collections
  • Methods
Name
The Name of the Component Interface is the unique name by which we can identify the CI. Calling the CI is also done with the help of this name.
Keys
These are special properties that can retrieve the values from a CI. The three types of keys that a Component Interface has are the following:
Get Keys: These keys return one instance of the Component Interface. These keys are created based on the search record and map to the Search Keys in the search record.
Find Keys: These keys return a list of instances of the CI. These too are created based on the search record and map to the combination of Search Keys and Alternate Search Keys of the Search record.
Create Keys: Create keys are created only when the associated Component has the Add action enabled.
Properties
Properties of a CI provide access to the Component InterfaceĆ¢€™s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are InteractiveMode, GetHistoryItems etc.
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
Collections
This is a special property that corresponds to a scroll area. It can contain fields or subordinate scrolls, as is the case in the Component. The default name of a collection would be same as that of the primary record for the underlying scroll.
Methods
Methods are functions that perform a specific task on a CI at runtime. Runtime access to each method is governed by the security level that you have for the specific method. Like Properties, Methods too can be classified into two:
Standard Methods: These are the methods that are available for all CIs. Certain standard methods like Find, Get, Save and Cancel get created automatically when CI is created. The Create method is created only if the underlying Component has the Add action enabled.
User Defined Methods: In addition to the standard methods, we can create our own functions and expose them through the CI as methods for added functionality. Such methods are called user-defined methods. Each user defined method maps to a function. Such methods are highlighted in blue in the Component Interface Designer.