Please do post your comments and suggestions for me to improve on chowdary1105@gmail.com

Wednesday, May 19, 2010

Page Start to Display in ADD mode (or) component in ADD mode

When we click on the component portal in menu then (the page with ADD button display) Then the following below PeopleCode Events will fire.


Search Processibg in Add Mode:
Record Field                    FieldDefault
ComponentRecordField   FieldDefault 
 Record Field                    FieldFormula 
Record Field                    RowInit 
Record Field                    SearchInit 
ComponentRecordlevel    SearchInit 
-->Enter the Employee and click on Add
Record Field                      FeildEdit  
ComponentRecordField     FeildEdit  
Record Field                      FieldChange  
ComponentRecordField      FieldChange  
Record Field                      Field Formula  
Record Field                      SaveEdit  
Record Field                      SearchSave 
ComponentRecordlevel      SearchSave 




 Page Dispaly (or)Component Build Process in ADD Mode:
Component Level                  Prebuild 
Record Field                         FieldFormula  
Record Field                         RowInit 
ComponentRecord                RowInit 
Component Level                  PostBuild 
Page Activate fires and displays the page 

Save Processing:

Record Field                    SaveEdit 
ComponentRecord           SaveEdit        
Record Field                    SavePrechange     
ComponentRecord          SavePrechange  
ComponentLevel             SavePrechange 
Record Field                  Workflow  
ComponentLevel            Workflow  
Record Field                  SavePostchange  
ComponentRecordlevel  SavePostchange  
Component Level           SavePostchange  

Search Process of a component in Update mode (UpdateDisplay/UpdateDisplayall) and Component Build Processing or Page build process in Update/Update Displayallmode

When we click on the component portal in menu then  the following below PeopleCode events will fire

Search Process
Record Field     SearchInit
ComponentRecord  SearchInit

-->Click on Search
Record Field    SearchSave
ComponentRecord SearchSave

Component Build Process or Page Build processing in Updatedisplay/UpdateDisplayall mode
-->Select the Employee ID from the list then
Record Field                      RowSelect
ComponentRecord            RowSelect
Component Level              Prebuild
Record Field                     FieldFormula
Record Field                     RowInit
ComponentRecord            RowInit
Component level               Postbuild
Page Activate fires and displays the page 

When we edit the field (Employee ID) then the following below PeopleCode Events will fire
-->Edit the field (Employee ID) and hit on save then the following peoplecode events will fire
Record Field                            FieldEdit
ComponentRecordField           FieldEdit
Record Field                           FieldChange
ComponentRecordField          FieldChange
Record Field                           FieldFormula

Save Processing PeopleCode Events:
Record Field                           SaveEdit
ComponentRecord                  SaveEdit     
Record Field                           SavePrechange   
ComponentRecordField          SavePrechange
ComponentLevel                    SavePrechange
Record Field                          Workflow 
ComponentLevel                    Workflow 
Record Field                          SavePostchange
ComponentRecordlevel          SavePostchange
Component Level                   SavePostchange

Monday, May 3, 2010

Inserting the data into 3 levels (0,1,2,3 levels) into database from flat file using Application Engine

Inserting the data into 3 levels (0,1,2,3 levels) into database from flat file using Application Engine Below is the sample code (Ive used 2 fields in all the 3 levels)

Level0 -> Organisational ID, Organisational Name
Level1 -> College ID, College Name
Level2 -> Department ID, Department Name
Level3 -> Employee ID, Employee Name, Age


Local Record &R0, &R1, &R2, &R3;

&R0 = CreateRecord(Record.A_ORG_TBL);
&R1 = CreateRecord(Record.A_COL_TBL);
&R2 = CreateRecord(Record.A_DEPT_TBL);
&R3 = CreateRecord(Record.A_EMPL_TBL);

&myfile = GetFile("C:\temp\harsha.txt", "R", %FilePath_Absolute);
&myfile1 = GetFile("C:\temp\har.txt", "W", "A", %FilePath_Absolute);
&myfile1.writeline("empty array creation");
&myarray = CreateArrayRept("", 0);

If &myfile.Isopen Then
   While &myfile.Readline(&str);
      &myfile1.WRITELINE("FILE OPENED");
      &myfile1.WRITELINE("string value is " | &str);
      &myarray = Split(&str, ",");
    
      SQLExec("SELECT A_ORGID FROM PS_A_ORG_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID);
      &myfile1.WRITELINE("array value of orgid is " | &ORGID);
      &myfile1.WRITELINE(" A_ORGID VALUE IS " | &ORGID);
    
    
      SQLExec("SELECT A_ORGID,A_COLID FROM PS_A_COL_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID1, &COLID1);
      SQLExec("SELECT A_ORGID,A_COLID,A_DEPTID FROM PS_A_DEPT_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID2, &COLID2, &DEPTID);
      SQLExec("SELECT A_ORGID,A_COLID,A_DEPTID FROM PS_A_DEPT_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID2, &COLID2, &DEPTID);
      SQLExec("SELECT A_ORGID,A_COLID,A_DEPTID,A_EMPLID FROM PS_A_EMPL_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID3, &COLID3, &DEPTID3, &EID3);
    
      If &myarray [1] = &ORGID Then
         &R1.A_ORGID.Value = &myarray [1];
         &R1.A_COLID.Value = &myarray [2];
         &R1.A_COLNAME.Value = &myarray [3];
         &R1.Insert();
         &myfile1.WRITELINE("values inserted at level 1 ");
         rem End-If;
         rem SQLExec("SELECT A_ORGID,A_COLID,A_DEPTID FROM PS_A_DEPT_TBL WHERE A_ORGID = :1", &myarray [1], &ORGID2, &COLID2, &DEPTID);
      Else
         &R0.A_ORGID.Value = &myarray [1];
         &R0.A_ORGNAME.Value = &myarray [2];
         &R0.Insert();
         &myfile1.WRITELINE("values inserted at level 0 ");
      End-If;
    
      If &myarray [1] = &ORGID1 And
            &myarray [2] = &COLID1 Then
       
         &R2.A_ORGID.Value = &myarray [1];
         &R2.A_COLID.Value = &myarray [2];
         &R2.A_DEPTID.Value = &myarray [3];
         &R2.A_DEPTNAME.Value = &myarray [4];
         &R2.Insert();
         &myfile1.WRITELINE("values inserted at level 2 ");
       
       
      End-If;
      If &myarray [1] = &ORGID2 And
            &myarray [2] = &COLID2 And
            &myarray [3] = &DEPTID Then
         &R3.A_ORGID.Value = &myarray [1];
         &R3.A_COLID.Value = &myarray [2];
         &R3.A_DEPTID.Value = &myarray [3];
         &R3.A_EMPLID.Value = &myarray [4];
         &R3.A_EMPNAME.Value = &myarray [5];
         &R3.A_EMPLAGE.Value = &myarray [6];
         &R3.Insert();
         &myfile1.WRITELINE("values inserted at level 3 ");
       
      End-If;
    
    
   End-While;
 
   &myfile.Close();
   &myfile1.Close();
End-If;

Wednesday, January 6, 2010

Steps for creating a GOTO ROW

STEPS FOR CREATING GOTO ROW
===========================
1.Create a new Field (TIN1_GOTOROW)
2.Create a new record (TIN1_GOWTO_WRK) and select the radio button Derived/Work.
Write the following below people code in the Field change in the Field level in TIN1_GOWTO_WRK table.
==============================================================================
&tinku = DoModal(Page.TIN1_GTROW_PNL, "Secondary Page ", - 1, - 1);

If (&tinku = 1) Then
&rowentered = GetRecord(Record.TIN1_GOWTO_WRK).GetField(Field.TIN1_GOTOROW).Value;
rem WinMessage("hai", 64);

If All(&rowentered) Then
¤trow = GetRowset();

If (1 <= &rowentered And
&rowentered <= ¤trow.activerowcount) Then
REM IN THE BAOVE THE HIGHEST VALUE WILL BE PERSENT;
&reqrow = GetRowset()(&rowentered);
&field = &reqrow.getrecord(1).getfield(1);
&field.SetCursorPos(%Page);
Else
WinMessage("THE ROW IS WITH IN THE TABLE ", 64);

End-If;

End-If;
End-If;

=============================================================================
3.Create a new secondary page (TIN1_GTROW_PNL)
4.Drag and drop the WRK record in to the page.
5.Save it.

Tuesday, January 5, 2010

Application Data Security

Defnition security is a form of data security.We use it to control access to particular rows of data (object definitions) in PeopleTools tables.

PeopleSoft also provides other methods to control the application data that a user is allowed to access in the PeopleSoft system. This task is also known as setting data permissions.With application data security, you can set data permissions at the following levels:

1.Table Level(Querry Security)
2.Row Level (SQL View)
3.Feild Level (People Code)

Table Level Security:
Table level security is implemented by using Querry security.
We can restrict the permissions to the users in accessing the tables while running and building the componenets

We can do this by creating querry acess group in PeopleSoft Tree manager and then assinning the users to those groups with PeopleSoft querry security.

PeopleSoft Query security is enforced only when usingPeopleSoft Query because it doesn’t control runtime page access to table data.

Row Level Security:
It can be implementd using SQL view's.
It controls the access to individual rows of data stored within application database tables
It enables the data of a particular user is permitted to access.

Field security:
Field level can be implemented using People Code.
Field security use people code to restrict access to particular fields or columns within application tables.

domodalcomponent steps

Drag and drop the 2 fields STUID,NAME from the work record in all the pages

1.Create the required fields and place them in to the record PS_SRI_STUMOD_TBL(*place the Student id and name in to the record*)
2.Create a Derived/Work record with 2 fields (stuid,name from grid) and save it with _WRK.
3.Place a hyperlink/ push button in the grid.In the hyperlink /pushbutton properties select the Destination as PeoplecodeCommand,record name:SRI_STU1_TBL and field name:SRI_STUABC_INFO and select the check button set component changed.

4.IN component level record field level assign the values to the Derived/Work record.
Local Rowset &RS0, &RS1, &RS2, &RS3;
&RS0 = GetLevel0();
&RS1 = &RS0(1).GetRowset(Scroll.SRI_ORG1_TBL);
For &I = 1 To &RS1.ActiveRowCount
&RS2 = &RS1(&I).GetRowset(Scroll.SRI_DEPT1_TBL);
For &J = 1 To &RS2.ActiveRowCount
&RS3 = &RS2(&J).GetRowset(Scroll.SRI_STU1_TBL);
For &K = 1 To &RS3.ActiveRowCount;
&SID = GetRecord(Record.SRI_STU1_TBL).GetField(Field.SRI_STU1_ID).Value;
&SNAME = GetRecord(Record.SRI_STU1_TBL).GetField(Field.SRI_STU1_NAME).Value;
SRI_STUAB_WRK.SRI_STU1_ID.Value = &SID;
SRI_STUAB_WRK.SRI_STU1_NAME.Value = &SNAME;
End-For;
End-For;
End-For;
DoModalComponent(MenuName.SRI_UNV_MNU, BarName.SRI_UNV_MNU, ItemName.SRI_STUABS_CMP, Page.SRI_STUABS_PNL, "A", Record.SRI_STUAB_WRK);
5.Call the other page /component using the DoModalComponent function.
DoModalComponent(MenuName.SRI_UNV_MNU, BarName.SRI_UNV_MNU, ItemName.SRI_STUABS_CMP, Page.SRI_STUABS_PNL, "A", Record.SRI_STUAB_WRK);
6.Create a View for the STUDENTID and NAME (SRI_STUAB_VW)
7.For STUDENTID in the table PS_SRI_STUMOD_TBL give the view (this makes the scroll change when we select different student id's)

Set ID and Business Unit

SetID
An identification code that represents a set of control table information or table sets. Set Ids enable the sharing of a set of control table information across two or more Business Units.

Table sets enable you to share control table information and processing options among business units. The goal is to minimize redundant data and system maintenance tasks. When you assign a setID to a record group in a business unit, you indicate that all of the tables in the record group are shared between that business unit and any other business unit that also assigns that setID to
that record group. For example, you can define a group of common job codes that are shared between several business units. Each business unit that shares the job codes is assigned the same setID for that record group."

Business Unit
An identification code that represents a high-level organization of business information. You can use a business unit to define regional or departmental units within a larger organization.

Business Unit organizes your company or your organization, SetIDs help you organize your data within the system. The HRMS system uses tables (Control Tables or Prompt Tables) that use a high-level key that enables you to identify and retrieve data from the system. A secondary high-level key, referred to as a SetID, has also been added on various tables. SetIDs are simply the labels used to identify a TableSet. Business Unit and SetID functionality in PeopleSoft HRMS also provides you with a higher business level for reporting purposes and other business data roll-up.

Difference between Transcation Tables and Control Tables

Transaction tables store data about day-to-day activities. Because of this, these tables are updated frequently and can be quite large. The type of transaction varies, such as invoices, paychecks, employee names and addresses, job history, benefits data.

Information in transaction tables is organized and stored by Business Unit.

Control tables store information that define the accounting structure and processing rules that are used when transactions are entered into your PeopleSoft applications. Control tables include master lists such as customers, vendors, products, country and location tables. It is important to note that Control tables are static, meaning they only change when you perform specific maintenance on them.

Control table information is organized and stored by a set identifier, commonly called a SetID.

Stand alone RowSet

STAND ALONE ROWSET
In PeopleCode a standalone rowset is an independent rowset object not associated with the component buffer. They allow you to work with data outside of the buffer by getting whatever additional data you need form the database. In this sense they replace the functionality of derived records which were once used as place holders to store data not directly associated with the component. Because a standalone rowset is standalone, there is no automatic action by the component processor on it. This means that if a standalone rowset is used to manipulate data (inserts/updates), code will need to be added to manually save the changes.

Code to create a standalone rowset object
Local Rowset &rsExample;
&rsExample = CreateRowset(Record.REC1);

Filling a standalone rowset
The Fill method in the Rowset class is used to populate the rowset. This parameters to the fill method are a Where clause and bind values. &rExample.Fill("where FIELD1 = :1", REC2.FIELD2);


The following example writes a file using a file layout that contains parent-child records:

Local File &MYFILE;
Local Rowset &rsBusExp, &rsBusExpPer, &rsBusExpDtl;
Local Record &rBusExp, &rBusExpPer, &rBusExpDtl;
Local SQL &SQL1, &SQL2, &SQL3;
&rBusExp = CreateRecord(Record.PERSONAL_DATA);
&rBusExpPer = CreateRecord(Record.BUS_EXPENSE_PER);
&rBusExpDtl = CreateRecord(Record.BUS_EXPENSE_DTL);

&rsBusExp = CreateRowset(Record.PERSONAL_DATA,
CreateRowset(Record.BUS_EXPENSE_PER,
CreateRowset(Record.BUS_EXPENSE_DTL)));
&rsBusExpPer = &rsBusExp.GetRow(1).GetRowset(1);

&MYFILE = GetFile("c:\temp\BUS_EXP.out", "W", %FilePath_Absolute);
&MYFILE.SetFileLayout(FileLayout.BUS_EXP_OUT);
&EMPLID = "8001";

&SQL1 = CreateSQL("%selectall(:1) where EMPLID = :2", &rBusExp, &EMPLID);
&SQL2 = CreateSQL("%selectall(:1) where EMPLID = :2", &rBusExpPer, &EMPLID);

While &SQL1.Fetch(&rBusExp)
&rBusExp.CopyFieldsTo(&rsBusExp.GetRow(1).PERSONAL_DATA);
&I = 1;
While &SQL2.Fetch(&rBusExpPer)
&rBusExpPer.CopyFieldsTo(&rsBusExpPer(&I).BUS_EXPENSE_PER);
&J = 1;
&SQL3 = CreateSQL("%selectall(:1) where EMPLID = :2
and EXPENSE_PERIOD_DT = :3", &rBusExpDtl, &EMPLID,
&rsBusExpPer(&I).BUS_EXPENSE_PER.EXPENSE_PERIOD_DT.Value);
&rsBusExpDtl = &rsBusExpPer.GetRow(&I).GetRowset(1);
While &SQL3.Fetch(&rBusExpDtl)
&rBusExpDtl.CopyFieldsTo(&rsBusExpDtl(&J).BUS_EXPENSE_DTL);
&rsBusExpDtl.InsertRow(&J);
&J = &J + 1;
End-While;

&rsBusExpPer.InsertRow(&I);
&I = &I + 1;
End-While;
&MYFILE.WriteRowset(&rsBusExp);
End-While;
&MYFILE.Close();

Out Put for the above program

CC8001 03/01/199802/15/1998011200 USDConference 00001
CC8001 03/01/199802/16/19980220000 JPYConference 00001

The following code shows an example of reading in a file and inserting the rows into the database:
Local File &MYFILE;
Local Rowset &rsBusExp, &rsBusExpPer, &rsBusExpDtl;
Local Record &rBusExp, &rBusExpPer, &rBusExpDtl;
Local SQL &SQL1;

&rBusExp = CreateRecord(Record.PERSONAL_DATA);
&rBusExpPer = CreateRecord(Record.BUS_EXPENSE_PER);
&rBusExpDtl = CreateRecord(Record.BUS_EXPENSE_DTL);

&rsBusExp = CreateRowset(Record.PERSONAL_DATA,
CreateRowset(Record.BUS_EXPENSE_PER,
CreateRowset(Record.BUS_EXPENSE_DTL)));

&MYFILE = GetFile("c:\temp\BUS_EXP.out", "R", %FilePath_Absolute);
&MYFILE.SetFileLayout(FileLayout.BUS_EXP_OUT);

&SQL1 = CreateSQL("%Insert(:1)");

&rsBusExp = &MYFILE.ReadRowset();
While &rsBusExp <> Null;
&rsBusExp.GetRow(1).PERSONAL_DATA.CopyFieldsTo(&rBusExp);
&rsBusExpPer = &rsBusExp.GetRow(1).GetRowset(1);
For &I = 1 To &rsBusExpPer.ActiveRowCount
&rsBusExpPer(&I).BUS_EXPENSE_PER.CopyFieldsTo(&rBusExpPer);
&rBusExpPer.ExecuteEdits(%Edit_Required);
If &rBusExpPer.IsEditError Then
For &K = 1 To &rBusExpPer.FieldCount
&MYFIELD = &rBusExpPer.GetField(&K);
If &MYFIELD.EditError Then
&MSGNUM = &MYFIELD.MessageNumber;
&MSGSET = &MYFIELD.MessageSetNumber;
End-If;
End-For;
Else
&SQL1.Execute(&rBusExpPer);
&rsBusExpDtl = &rsBusExpPer.GetRow(&I).GetRowset(1);
For &J = 1 To &rsBusExpDtl.ActiveRowCount
&rsBusExpDtl(&J).BUS_EXPENSE_DTL.CopyFieldsTo(&rBusExpDtl);
&rBusExpDtl.ExecuteEdits(%Edit_Required);
If &rBusExpDtl.IsEditError Then
For &K = 1 To &rBusExpDtl.FieldCount
&MYFIELD = &rBusExpDtl.GetField(&K);
If &MYFIELD.EditError Then
&MSGNUM = &MYFIELD.MessageNumber;
&MSGSET = &MYFIELD.MessageSetNumber;
End-If;
End-For;
Else
&SQL1.Execute(&rBusExpDtl);
End-If;
End-For;
End-If;
End-For;
&rsBusExp = &MYFILE.ReadRowset();
End-While;
&MYFILE.Close();

Basic HRMS Setup's and adding the Benefits to the Employee Setup

Create SETID
Navigation:
Main Menu ->PeopleTools ->Utilities ->Administration ->TablesetID's

Create Business Unit
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Business Unit

Setup Location:
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Location

Add a company
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Company

Create an Establishment ID
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Establishment

Create Departments
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Departments

Setting the Business Unit options default
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Business Unit options default (Enter the company and Country details)

Create a pay Group Table:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Pay Roll ->Pay Group Table

Create a Job Code
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Job Attributes ->Job Code Table

Setting Org Defaults permission lists
Navigation:
Main Menu ->Setup HRMS ->Foundation Tables ->Organisation ->Org Defaults by permission Lists (Enter the Organisation related
data here)

Tree Manager:
Navigation:
Main Menu ->Tree Manager->Tree Utilites ->Tree Manager
->Create a new tree with the name DEPT_SECURITY
->Select the structure ID as DEPARTMENT
->Select the category as HR
->Click on ADD LEVEL and add the following below levels
1.Corporate
2.Business
3.Region
4.Company
5.Department
6.Division
7.Group
8.Unit
->Select the root node
->save it.
Note: In Business Options Default enter the details.

Security:
Navigation:
Main Menu ->Security ->Core Row Level Security ->Security by Permission Lists
->Select HCDPALL.Add ur business uint it and select the 011 as Security acess type.

Security by Dept Tree:
Navigation:
Setup HRMS ->Security ->Core Row level Security ->Security by Dept Tree
->Select HCDPALL.Add your SETID and Department ID in it.


Running the Process:
Navigation:
Setup HRMS ->Security ->Core Row Level Security->Refresh SJT Class ALL / Refresh Trans SJT Tables / Refresh SJT OPR class

Run all the above process

Buzz the Application
Navigation:
Setup HRMS ->Install -> Installation Table
->Change the SETID and Campany Name.
->Restart the services.

Adding a Person:
Navigation:
Main Menu ->Workforce Administration -> Personal Information ->Add a Person.

Adding the Benfits to the existing Employee:
===================================
Base Benfits:
Adding a Health Plan to an Existing Employee:

Provider / Vendor Tables:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Base Benfits ->Plans and Providers ->Provider/ Vendor Tables ->Vendor ID

Benfit Plan Type:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Base Benfits ->Plans and Providers ->Provider/ Vendor Tables ->Benfit Plan Type

Health Plan Table:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Plan Attributes ->Health Plan Table

Health Coverage Codes:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Plan Attributes ->Health Coverage Codes

Rates and Rules:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Base Benfits ->Rates and Rules ->Benfit Rates.

Deduction Code:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Payroll Interface ->Deductions ->Deduction Tables.

Cloning the Benfit Program Utility:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Base Benfits ->Program Structure ->Benfit Program clone Utility.

->Select required Basic benfits and clone it.

Benfit Program Table:
Navigation:
Main Menu ->Setup HRMS ->Product Related ->Base Benfits ->Program Structure ->Benfit Program Table.

Adding the Benfit to the Employee:
Navigation:
Main Menu ->Workforce Administration ->Job Data ->Select the EMPLID ->Click on the Benfit program participation link ->Add the benfit program.

Check it in Benfits
Navigation:
Main Menu ->Benfits ->Enroll in Benfits ->Assign to Benefit Program ->Select the EMPLID and check for Benfits.