Peoplecode Question Ans

97
PeopleSoft HRMS For PeopleSoft 8 Version 1.0 (© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. ) © Patni Computer Systems Ltd. EAI, PeopleSoft. 2002. Page of 97 Patni Internal 1

Transcript of Peoplecode Question Ans

Page 1: Peoplecode Question Ans

PeopleSoft HRMS

ForPeopleSoft 8

Version 1.0

(© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002.)

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

1

Page 2: Peoplecode Question Ans

PeopleSoft HRMS

QUESTIONS

PeopleCode Statements

Navigation

Understanding PeopleCode Events

Component Processor Flow

PeopleCode Language

Objects and Classes in PeopleCode

Methods And Built-In Functions

Referencing Data In Component Buffer And Data Buffer

PeopleCode Related to Internet Architecture

PeopleCode Built-In Functions And Classes

Miscellaneous Functions

Debugger

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

2

Page 3: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 1:PeopleCode Statements

1. What are the various definitions (places) where you can attach PeopleCode programs?

Record field, page, component, component record, component record field, menu

2. What are the various places from where you can access Record Field PeopleCode?

3. How many PeopleCode events are associated with a Record Field?15 events

4. What are the various events associated with Component Record Field?

FieldChange FieldDefault FieldEdit PrePopup

5. What are the various events associated with Component?

PreBuild PostBuild SavePreChg Workflow SavePostChg

6. How do you access events associated with a Component? Open component ->Go to Sturcture tab ->Right click on Component name->View peoplecode

7. If the parent is a component for which the PeopleCode editor is opened then what are the child definitions where you can attach PeopleCode?

Record field peoplecodePage peoplecode.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

3

Page 4: Peoplecode Question Ans

PeopleSoft HRMS

8. What is the restriction for attaching PeopleCode to menu items?

9. What is the PeopleCode event associated with a Page?Page Activate event

10.When can you attach PeopleCode with a push button? What are the events that are triggered with a push button action?

Fieldchang,Fieldedit

11.What are the different types of Component Record Event – sets? FieldChange FieldDefault FieldEdit PrePopup

12.Can you attach Page PeopleCode to Secondary Page and Sub-Page?

We can attach peoplecode to secondary page,but not to sub page.

13.What are the events associated with Menu Item attached to a page?

ItemSelected and PrePopup PeopleCode

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

4

Page 5: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 2:Navigation And PeopleCode Editor

1. If a Record contains 7 fields, then how many PeopleCode editor windows can be opened for the various fields?Only one

2. When working inside the PeopleCode editor how would you know what all events for that particular child, have PeopleCode associated (written) with them?

In appliaction designer PeopleCode Display mode contains a column for each PeopleCode program type and specifies whether a program exists

3. How many PeopleCode editors can be opened in object workspace?

Only one

4. How do you format your program in PeopleCode editor?by clicking the Validate syntax button on toolbar or by saving the same program

5. PeopleCode statements are case insensitive. True/False. If true then how do you make them case sensitive?

Not case sensitive

6. Can two Editor windows for the same parent or for any two of its child definitions be opened simultaneously?

NO

7. How can you validate the whole project?Go to Application Designer Select Tools ---> Validate Project.

8. What is the benefit of dragging and dropping an object definition from Project Workspace into Object Workspace?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

5

Page 6: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 3:Understanding PeopleCode Events

1. When does Page activate event fire?When page loads

2. When you attach a WinMessage(“hello “ | “ Hi”); to a sub-page in its activate event what will happen? Can this WinMessage work?

No,bcz peoplecode does not work at sub page activate.

3. What are the various places a FieldChange event can be triggered for a particular field?

Record field

4. When a default is set for a field in the record field properties and a default is given programmatically in the field default event then which one will take precedence and why?

Ofcourse,default set in the record field properties,because at the time of page loads default value gets assigned and after that peoplecode gets executed.

5. What are the events that get triggered when a field is changed?a.Fieldedit,fieldchenge,saveedit,saveprechange,workflow,savepostchange

6. Which event is triggered when a popup menu is accessed? ItemSelected7. A menu has 2 PeopleCode events associated with it. Which are

they?1.Itemselected,PreoPopup

8. If a popup menu is attached to a page then how do you control it in the pre-popup event?

Using peoplecode functions CheckMenuItem, DisableMenuItem, EnableMenuItem, HideMenuItem, and UncheckMenuItem etc.

9. When does a RowInit event fire?•Triggered the first time the Component Processor encounters a row of data,ie, it occurs during Component Build Processing and RowInsert Processing.•RowInit is often paired with FieldChange peoplecode

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

6

Page 7: Peoplecode Question Ans

PeopleSoft HRMS

10. When does RowInit event not fire?in some cases, the record can be initialized entirely from the keys for the component. When this happens, RowInit PeopleCode is not run

11. When does a row insert event fire?

12. If you insert a row and save the page without making any changes then what happens at the backend?

Newly inserted row gets deleted.

13. When you insert 2 rows and without entering any values in the fields of the first row and entering some values for the second row, if you save the changes what happens at the backend?

First empty row will get deleted

.14. What is the basic difference between SaveEdit and

FieldEdit?SaveEdit is used to cross validates page fields ,checking consistency among page field values.FieldEdit is used to validate page fields and SaveEdit is used to validate component fields.

15. What is the last event where PeopleCode can be used to change the data of the fields on the page before updating takes place on the database?

SavePrechange

16. When does SearchInit event fire? Where should you attach the code for this event?

SearchInit PeopleCode is performed before the search record dialog box is displayed. It provides a way to control processing before an operator enters values in the search key & alternate search key fields.

17. When does SearchSave event fire? Where should you attach the code for this event?

SearchSave PeopleCode is performed after the operator selects the OK button in the search record dialog box. The most common use of this PeopleCode event is to force the operator to input at least one field into the dialog box.

18. Search for the backup of your PeopleCode program and indicate where the copy is saved. When is the automatic backup file created?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

7

Page 8: Peoplecode Question Ans

PeopleSoft HRMS

The file is saved to your temp directory (as specified in your environment), in a file with the following name:

PPCMMDDYY_HHMMSS.txt

where MMDDYY represents the month, date, and year, respectively, of the checkpoint, and HHMMSS represents the hour, minute, and second, respectively

19. How do you copy PeopleCode programs?20. What is the basic difference between FieldChange and

FieldEdit?21. If code is written in Record Field FieldChange and

Component Record Field FieldChange of a field then what will be the order of firing of these two events?

Record Field FieldChange then Component Record Field FieldChange

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

8

Page 9: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 4:Component Processor Flow

1. If a code is written in Record Field FieldChange and Component Record FieldChange, what will the end user see?Record Field Change

2. If a field has a default value set in its record field property and if a code is written to set the default values which of the two values do you think will appear in the field?

3. A page has a record A at level 0 (parent level) and a record b at level 1 (scroll area and child level), if SaveEdit event of a field in both record has PeopleCode program written in them, also component record has PeopleCode written for both the records then what will be the order of the events firing?

4. FieldDefault event will always fire. True/False.This is true if there is no default specified, if a null value is specified, or if a 0 is specified for a numeric field

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

9

Page 10: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 5:PeopleCode Language

1. What are the different conventional data types?Any,Boolean,date,datetime,float,integer,number,string,time2. What are the different user-defined declaration types and what

are their life spans?3. What is the data type of the variable, which is not declared?4. If an undeclared variable is assigned a string value and

subsequently assigned a numeric value then what is the error that occurs?

It will save numeric value.

5. If a variable is defined as a string data type and if you try to assign it a numeric value then will it work?

No,it will give error left side string data type not match with right side numeric data type.

6. If you have a Boolean variable and want to make it true then which one should generally be used?

Local Boolean &bool;&bool = “True”;

OR

&bool = “True”;2nd one.because at first one as we defined &bool as Boolean, we r assigning it string value.So, it will not work

7. How do you differentiate between system variables and user-defined variables?

8. If you have a component level variable and you want to use it in different records in the same page then where all would you have to define them?

9. Global variables should not be used generally. What other thing can you use to suffice the functionality of the global variable?

We can use component variable.

10. What is the basic disadvantage of using global variables?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

10

Page 11: Peoplecode Question Ans

PeopleSoft HRMS

Use global variables rarely, because they are difficult to maintain.

Global variables are not available to a portal or applications on separate databases

11. What is the maximum length of a field definition? 25412. What is the data type of a date and integer addition?

date13. How would you subtract days from a given date?

Date1-date214. How would you check whether the date field is blank or

not?15. What is the use of @ operator?

@operator converts string into defintion reference.

Chapter 6:Objects And Classes in PeopleCode

1. How can you instantiate an object? What is the difference between GET and Create?

2. Can you pass PeopleCode objects as function parameters?3. Can you use ObjectGetProperty in all events?4. Which one of the following is proper (REC – Record, FLD-Field):

FLD1 = REC.GetField(Field.FLD);o &Value = FLD1.Value;

&Value = REC. GetField(Field.FLD).Value;

&Value = REC.FLD.Value;

5. What will be the result:

Local array of number &ARR1;Local array of string &ARR2;

&ARR1[1] = 10;&ARR1[2] = 20;&ARR2 = &ARR1;WinMessage(&ARR2[2]);

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

11

Page 12: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 7:Methods And Built-In Functions

1. What are Think Time Functions? They should not be used in which events and why?

"Think-time" functions suspend processing either until the user has taken some action (such as clicking a button in a message box), or until an external process has run to completion (for example, a remote process).

Think-time functions should be avoided in any of the following PeopleCode events:

· SavePreChange · Workflow· RowSelect· SavePostChangeViolation of this rule can result in application failure.

2. How can you use WinMessage in SavePreChange?3. What happens when you try to access a field that is not in the

data buffer?4. Where Can You Attach DoSave?FieldEdit, FieldChange, or MenuItemSelected

5. Which is the earliest event in which you can use GetGrid? Why?PageActivate event. Peoplesoft builds the page grid one row at a time. For that,Gird class is used to build the complete grid.We can not attach peoplecode which uses Grid class before grid is build.So,earliest event use for getgrid is Page Activate event.

6. Which is the earliest event in which you can use GetPage?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

12

Page 13: Peoplecode Question Ans

PeopleSoft HRMS

GetPage

Syntax

GetPage(PAGE.pagename)

Description

Use the GetPage function to return a reference to a page object. Generally, page objects are used to hide or unhide pages in a component.

Note. The page object shouldn’t be used until after the Component Processor has loaded the page: that is, don’t instantiate this object in RowInit PeopleCode, use it in PostBuild or Activate instead

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

13

Page 14: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 8:Referencing Data In Component Buffer And Data Buffer

1. What are the two Ways Of Referring to data in Component Buffer?

2. What is a Rowset? What is a Row?3. If there is Level 0, Level 1and Level 2 in a page then what is the

processing order in contextual reference?4. What is the difference between GetRowset()(1) and

GetRowset().GetRow(1).5. Consider the code

&Var = &Row.GetRecord();What will be the content of &Var?

6. Write a code to access DELIVERY ID that is in level 3 of TRG_DELIVERY_TBL page.

7. Write a code to access all the PRODUCT_ID in TRG_ORDER_TBL page. Hint – use loop.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

14

Page 15: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 9:PeopleCode Related to Internet Architecture

1. Why should you use deferred processing mode?2. Why should you avoid FieldEdit and FieldChange event if your

application is to be designed for Internet?3. What happens when Internet Architecture application calls a

client-only PeopleCode function at runtime?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

15

Page 16: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 10: PeopleCode Built-In Functions And Classes

1. What type of array is declared by the definition Local Array &ARR1;

2. How will you declare a three dimensional array of numbers?3. How can you read values from an array?4. Suppose there is a following binary code in which 0 is used as

separator. How will you separate this code into elements?Code: 1101111010101011

5. How will you print all the elements of an array?6. Will ComponentChanged fire if there are no changes in the

current page and a new page is called using DoModal/TransferPage?

7. If a parent record is deleted then its child record is also deleted. Is vice versa also true?8. In which event is PriorValue function generally used?9. Will this code set the required cursor position? Give reason?

&Num = TRG_QUANTITY;&Cost = &NUM * 10;If &Cost > 100 then

Error(“TRANSACTION FAILED”);SetCursorPos();

End-If;10. On which types of fields can you use SetDisplayFormat

function?11. What is the difference between GetLevel0() and GetRowset().12. Can you add dynamic tree control on Level 2 of a page?

13. Consider the following code:(level0 – Record0, Level1- Record1)

&TREENODE = GetSelectedTreeNode(Record. Record0);&PARENT_NODE = GetTreeNodeParent(&TREENODE);&Value = GetTreeNodeValue(&PARENT_NODE, TRG_ORDERS.TRG_ORDER_ID);What will be value of &Value?

14. What is the difference between DoSave() and DoSaveNow()?15. How will you implement (When statement1 And Statement2) in

Evaluate Statements?16. How can you create a new URL identifier?17. What happens when SetDefault is used and Default values are

not provided in that field?18. Can one modal component call another modal component?19. What is the difference between Transfer and TransferPage?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

16

Page 17: Peoplecode Question Ans

PeopleSoft HRMS

20. Can you enable a field that is disabled through Page Field Properties of that field?

21. In which event can we write ClearSearchDefault?22. In which events you can attach SQL statements that cause

database updates?23. Suppose your functions demands that the user should re-

enter the password. How can you attain this?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

17

Page 18: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 11: Miscellaneous Functions

1. What are the System variables available for current date and time?

2. What are the different %mode options?3. How can you check the permission list of the current user?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

18

Page 19: Peoplecode Question Ans

PeopleSoft HRMS

Chapter 12: Debugger

1. How many application designer sessions can be simultaneously run?

2. How many Debugger sessions can be run?3. How many components can be debugged in a given session? Is

there any limitation?4. What are break points and how do you set them?5. How do you remove the break points?6. How would you keep a break point inside a comment?7. If the break points are set at the start of programs, then how

many windows will be opened for the Debugger session?8. If you lose the current execution location of the PeopleCode

Program then how would you search where the PeopleCode is currently running?

9. What is the basic difference between the Step and Step Over options available with Debugger?

10. How do you jump from one break point to another?11. When you abort the PeopleCode debugger session then what happen to the programs?

What is the error that you get?12. What are the various variable panes available in

PeopleCode?13. Suppose you want to know where all you have written

WinMessage command, then how do you do it?14. Where all does the Find In option search for the typed text?

1 What are the events associated with Menu Item attached to a page?ItemSelected and PrePopup PeopleCode

2. What are the various places a FieldChange event can be triggered for a particular field?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

19

Page 20: Peoplecode Question Ans

PeopleSoft HRMS

Record Field FieldChange and Component Record Field FieldChange3. What are the events that get triggered when a field is changed?

a. Fieldedit,fieldchenge,saveedit,saveprechange,workflow,savepostchange4. Which event is triggered when a popup menu is accessed?

ItemSelected

5. A menu has 2 PeopleCode events associated with it. Which are they?

6. If a popup menu is attached to a page then how do you control it in the pre-popup event?

Using peoplecode functions CheckMenuItem, DisableMenuItem, EnableMenuItem, HideMenuItem, and UncheckMenuItem etc.

7. When does a RowInit event fire?•Triggered the first time the Component Processor encounters a row of data,ie, it occurs during Component Build Processing and RowInsert Processing.•RowInit is often paired with FieldChange peoplecode

8. When does a RowInit event not fire?in some cases, the record can be initialized entirely from the keys for the component. When this happens, RowInit PeopleCode is not run

9. Search for the backup of your PeopleCode program and indicate where the copy is saved. When is the automatic backup file created?

The file is saved to your temp directory (as specified in your environment), in a file with the following name:

PPCMMDDYY_HHMMSS.txt

where MMDDYY represents the month, date, and year, respectively, of the checkpoint, and HHMMSS represents the hour, minute, and second, respectively

10. How do you copy PeopleCode programs? simple11. If code is written in Record Field FieldChange and Component Record Field

FieldChange of a field then what will be the order of firing of these two events? Record Field FieldChange then Component Record Field FieldChange12. If a code is written in Record Field FieldChange and Component Record FieldChange,

what will the end user see?

13. FieldDefault event will always fire. True/False.

This event is initiated on all page fields as part of many different processes; however, it triggers

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

20

Page 21: Peoplecode Question Ans

PeopleSoft HRMS

PeopleCode programs only when the following conditions are all true:

The page field is still blank after applying any default value specified in the record field properties.

This is true if there is no default specified, if a null value is specified, or if a 0 is specified for a numeric field.

The field has a FieldDefault PeopleCode program

14. What is the data type of the variable, which is not declared?auto-declared

15. If you have a component level variable and you want to use it in different records in the same page then where all would you have to define them?All places

01. What is the purpose of temperory record and state record?1a. Temp.record does not have a physical existence whereas state record has.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

21

Page 22: Peoplecode Question Ans

PeopleSoft HRMS

Temporary Records store the Transient or intermediate results during a program run.In a state record only a unique line is stored for a process instance.

02. What the events of components and when /why are they used?2a. SaveEdit, save postchg, prebuild, workflowSaveedit is used while saving the component. This event is used for validating the consistency of the data in Component fields.Any post save related updations are carried out in savepost chg event. i.e. for all those records which requires an updation but not present in the component.The PreBuild event fires before the rest of the component build events. This event is often used to hide or unhide pages. It’s also used to set component variables.The main purpose of Workflow event is to segregate peoplecode related to workflow from rest of the applications peoplecode

03. Why use work records when we have variables?3a. work record is by default declared globally and can be attached to any field, whereas a variable is a temporary memory allocation and scope of the same can be Local or global.

04. What does session object signify in the CI?4a. it connects to a session on peoplesoft application server.

05. What are the common sqc's? why are they used?5A. CURDTTIM.SQC, DATETIME.SQC, PRCSAPI.SQC, PRCSDEF.SQC, READXLAT.SQC, GETSELCT.SQC, TRANCTRL.SQC, EOJ.SQC

06. What is the difference between Do Select & a Do When?6A. DO select action can be reselected and restartable whereas do when does not have such options.

07. What is Component Buffer?7a. the area in memory that stores data for the currently active component.

08. What are the frequently used SQC?8a. #INCLUDE 'SETENV.SQC' - SET ENVIRONMENT PROCEDURE#INCLUDE 'SETUP02.SQC' - PRINTER AND PAGE-SIZE INITIALIZATION#INCLUDE 'SQRTRANS.SQC' - SET TRANSLATION PARAMETERS

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

22

Page 23: Peoplecode Question Ans

PeopleSoft HRMS

#INCLUDE 'BILASER.SQC' - PRINTER DEFINITION (HP LASER OR LINEPRINTER)#INCLUDE 'PRCSDEF.SQC' - DEFINE-PRCS-VARS PROCEDURE#INCLUDE 'PRCSAPI.SQC' - GET-RUN-CONTROL-PARMS PROCEDURE#INCLUDE 'RESET.SQC' - RESET PROCEDURE#INCLUDE 'CURDTTIM.SQC' - GET-CURRENT-DATETIME PROCEDURE#INCLUDE 'NUMBER.SQC' - ROUTINES TO FORMAT NUMBERS#INCLUDE 'DATETIME.SQC' - INIT-DATETIME PROCEDURE#INCLUDE 'EOJ.SQC'

09. Use of SQLExec?9a. It creates an sql command within the peoplecode program that bypasses component processor and directly interacts with the dtbase to Insert Update or delete.

10. What is dynamic view?10a. dynamic view is a normal sql view consisting of Meta-Sql constructs.

11. What is the difference between fieldchange and fieldedit?11a. FieldChange PeopleCode is used to recalculate page field values, perform other processing that results from a field change other than data validation. Also validates the contents of the field.FieldEdit PeopleCode is used to validate the contents of a field, supplementing the standard system edits.

12. What is Page Activate Event?12a. It's an event which fires everytime when the page gets activated.

13. Actions in Application engine. Different types of application engines?13a. Do while, Do select, Do Until, Do When

14. Name the joins used in sql.14a. Equi-join, Outer-Join, Inner-Join.

15. How to open a secondary page through the peoplecode? and how do refer the fields in the secondary page?15a. Using the Do Modal Function we can open the Secondary Page thru PeopleCode.

16. Sequence of execution of events in peoplecode?16a. Record.Field Edit ---> Component.Record.Field Edit --->

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

23

Page 24: Peoplecode Question Ans

PeopleSoft HRMS

Record.Field Change ---> Component.Record.Field Change --->

17. Field Length of Translate value.17A. Character 1 to Character 4

18. Difference between prompt table and translate table.18a. A Translate Table stores Field values which consists of a relatively small,static set of values that are not maintained by the user whereas in case of Prompt Table the data dictionary is maintained by the user.

19. Use of effective date.19a. A method of dating information in PeopleSoft applications. You can predate information to add historical data to your system, or postdate information in order to enter it before it actually goes into effect. By using effective dates, you don't delete values; you enter a new value with a current effective date.

20. Type of tables are allowed as a state records in AE.20a. Derived work records or Physical records can be used as State Records in AE.

21. Which fields will be loaded into component buffer if a component is opened? i.e. if there are 10 fields in a record and only 3 fields are placed on the page. then all the remaining fields will be available in the component buffer or only those fields which are placed on the component?21a. all fields values will be loaded in the component buffer.

22. How do retrieve/assign a record field which is not placed in the component.22a.By Creating an Object of the same.

23. Types of sql objects used in peoplecode.23a. Normal/Application engine and Record View

01. What are the various definitions (places) where you can attach PeopleCode programs?1a. All record/ Message/ Page/Menu related events.

02. What are the various places from where you can access Record Field PeopleCode?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

24

Page 25: Peoplecode Question Ans

PeopleSoft HRMS

2a. we can access the same from any event provided the event people code is declared accordingly.

03. How many PeopleCode events are associated with a Record Field?3a. Fifteen events

04. What are the various events associated with Component Record Field?4a. The various events associated with Component Record Field are Field Default, Field Edit, Field Change and Pre-Popup

09. What is the PeopleCode event associated with a Page?9a. Page activate

10. When can you attach PeopleCode with a push button? What are the events that are triggered with a push button action?10a. When a Push Button is tagged to a derived record peoplecode can be llinked to it.recordfield field change event is triggered with a push button action.

13. What are the events associated with Menu Item attached to a page?13a. ItemSelected event is associated with Menu Item attached to a page.

01. If a Record contains 7 fields, then how many PeopleCode editor windows can be opened for the various fields?1a. Only one.

02. When working inside the PeopleCode editor how would you know what all events for that particular child, have PeopleCode associated (written) with them?2a. In appliaction designer PeopleCode Display mode contains a column for each PeopleCode program type and specifies whether a program exists

03. How many PeopleCode editors can be opened in object workspace?3a. Only one.

04. How do you format your program in PeopleCode editor?4a. by clicking the Validate syntax button on toolbar or by saving the same program.

05. PeopleCode statements are case insensitive. True/False. If true then how do you make them case sensitive?5a. Not case sensitive.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

25

Page 26: Peoplecode Question Ans

PeopleSoft HRMS

06. Can two Editor windows for the same parent or for any two of its child definitions be opened simultaneously?6a. No

07. How can you validate the whole project?7a. Go to Application Designer Select Tools ---> Validate Project.

08. What is the benefit of dragging and dropping an object definition from Project Workspace into Object Workspace?8a. drag and drop from project window.

25. Name the objects used in peoplecode.25a.The various objects used in peoplecode are Records, Fields, SQL, Components, Pages, Menu.

07. If the parent is a component for which the PeopleCode editor is opened then what are the child definitions where you can attach PeopleCode?7a. PeopleCode can be attached to the related Pages and Records of that component.

11. What are the different types of Component Record Event – sets?11a.The different types of Component Record Event-Sets are RowDelete, RowInit, RowInsert, RowSelect, SaveEdit, SavePostChg, SavePreChg, SearchInit, SearchSave

12. Can you attach Page PeopleCode to Secondary Page and Sub-Page?12a. yes

32. How many scrolls can there be on a page?32a. Level0 (Non-Scrolling), Level1, Level2, Level3, Level4

36. How to refer a field value in Scroll level three?36a. &FLD2 = GetLevel0().GETROW(1).GetRowset(Scroll.PCS_BSS_LVL_R).GETROW(1).GetRowset(Scroll.PCS_BSS_LVL_R1).GetRow(&I).GetRecord(Record.PCS_BSS_LVL_R1).GetField(Field.ADDRESS);

28. In a Do Select when using a Restartable AE what care shoud be taken by the programme while writting the code?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

26

Page 27: Peoplecode Question Ans

PeopleSoft HRMS

28a.Suppose the Do select Returns 10 rows and AE continues its processing then program is aborted at 5th row. Next time when the AE is restarted care should be taken that it should start at Row no. 5

08. What is the restriction for attaching PeopleCode to menu items?06. How do you access events associated with a Component?27. What are the various append modes for a file? how will you append in the beginning?29. Can work records be used in a Reselect?31. Can we make use of work records and still make it restartable?34. If you get an error in SQR log inspite of you getting the report output;what type of error is it & why?35. Export & Import of data via AE?(Have u done it anywhere)

SQR

1. What are the common SQC’s used in Report #INCLUDE 'USEPRNTR.SQC'#INCLUDE 'SQRTRANS.SQC' ! SET TRANSLATIONS#INCLUDE 'NUMBER.SQC' ! FORMATS NUMBERS#INCLUDE 'CURDTTIM.SQC' ! GET-CURRENT-DATETIME PROCEDURE#INCLUDE 'DATETIME.SQC' ! ROUTINES FOR DATE AND TIME FORMATTING#INCLUDE 'PRCSAPI.SQC' ! UPDATE PROCESS REQUEST API#INCLUDE 'PRCSDEF.SQC' ! UPDATE PROCESS REQUEST VARIABLE DECLARE#INCLUDE 'GETSELCT.SQC' ! FORMAT INPUT VARIABLES#INCLUDE 'RESET.SQC' ! RESET PRINTER PROCEDURE#INCLUDE 'EOJ.SQC'

2. How many section are available in SQR

4 SECTIONS : Setup , Heading , Body and Footing

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

27

Page 28: Peoplecode Question Ans

PeopleSoft HRMS

3. Which is the Required Section in SQR

Body Section

4. What is difference between Begin-Report and Begin- Program.

Both commands are technically Same and used at starting of body section. Begin-report is a command used in older version of SQR. In new version of SQR though it support begin-report command, it does not work well with sqr’s new functionality.

5. Can you write Select statement in Begin-SQL Section

NO Only non-SELECT (like UPDATE , INSERT ) statements can be used (except SELECT INTO for SYBASE andMicrosoft SQL Server). Columns and variables can be referenced in the SQLstatements.

6. How do you call the procedure in SQR

Using DO Command ( do get_names )

7. What is the difference between Display and Show command

The DISPLAY command (One field on one line ) can be used to display data to a terminal. If you wish to display more than onefield on the same line, use NOLINE on each display except the last.

If you require more control over the display, use the SHOW command.

display ’You owe ’ nolinedisplay #taxes money nolinedisplay ’ in back taxes.’

Produces the following output:

You owe $123,456.78 in back taxes.

Show : Displays one or more variables or literals on the screen.

show ’You owe ’ #taxes money ’ in back taxes.’Produces the following output:You owe $123,456.78 in back taxes.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

28

Page 29: Peoplecode Question Ans

PeopleSoft HRMS

8. Can you print the result on one line using Display command.

YES . Use Noline command

9. What are the parameters required to connect the database using SQR

-DBdatabase –Dbconnectionstring ( : Databasename, dsn name, userid, password )

( BEGIN-SQL -DBMANTHAN -DB' DSN=MANTHAN; UID=psinterface; PWD=interface'!INSERT INTO INTERFACE_STATUS (PROCESS_ID,…. )

10. Can you tell us the SQR report execution flow using Process Scheduler.

Setup section -> body Section -> heading -> footer It checks the heading and footer part at compile time

( The PRINT command places text in memory, not on paper.SQR for PeopleSoft always prepares a page in memory before printing it to paper, performing the body first, then the HEADING and FOOTING sections )

11. What are the type of variable used in SQR

Global/Local VariablesGlobal/Local Variables SQR procedures that contain variables which are visible throughout theprogram are called global procedures. In contrast, procedures that takes arguments, such as the spell_number procedure in this chapter’s check-printing sample code, are local procedures. In SQR, any procedure that takes arguments is automatically considered local. We recommend that you declare a procedure as local even if it does not take any arguments. Simply place the keyword LOCAL after the procedure name in the BEGIN-PROCEDURE command.

To reference a global variable from a local procedure, insert an underscorebetween the prefix character (#, $, or &) and the variable name.

Variables in global procedures are visible throughout the program.· Variables in local procedures are visible only within the procedure.· To reference a global variable from a local procedure, place anunderscore between the prefix character #, $, or & and the variablename.· To pass an argument back to its calling procedure, preface it with a

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

29

Page 30: Peoplecode Question Ans

PeopleSoft HRMS

colon.

12. What is the difference between LET and MOVE command

Both are assignment stmts. Let allows you to buildExpressions like addition subtraction etc. Move does not allow that. MOVE is used when value of one variable is assigned to another variable and both variables are of different Datatype.

13. What is the use of ON-BREAK.

the ON-BREAK option of the PRINT command accomplishes two related tasks—it starts a new group each time the value of state changes, and prints state only when its value changes. Note that ON-BREAK works as well for implicit as for explicit PRINT commands,

14. What is the purpose of -F flag and –O flag

-O[file] Directs log messages to the specified file or to program.log if no fileis specified. By default, the file sqr.log is used in the currentworking directory.

15. What is the difference between ASK and INPUT command.

ASK command in the SETUP section prompts the user at compile time. The value that the user enters is placed in a special kind of variable called a substitution variable. This variable can be used to substitute any command, argument, or part of a SQL statement at compile time.

The ASK command can only be used in the SETUP section. ASK commands are always performed at compile time before program execution begins. Therefore, all ASK commands are performed before any INPUT command is performed.

INPUT is more flexible than ASK. You can use INPUT inside loops. You can validate the length and type of data input and reprompt if it is not valid. ASK can be more powerful. Substitution variables set in an ASK command let you modify commands that are normally quite restrictive.

16. What is Load-Lookup

(Use LOAD-LOOKUP to simplify joins , for better performance )

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

30

Page 31: Peoplecode Question Ans

PeopleSoft HRMS

With LOAD-LOOKUP, you can reduce the number of tables that are joined in one SELECT. This command is used in conjunction with one or more LOOKUP commands.The LOAD-LOOKUP command defines an array containing a set of keys and values and loads it into memory. The LOOKUP command looks up a key in the array and returns the associated value. In some programs, this technique will perform better than a conventional table join.LOAD-LOOKUP can be used in the SETUP section or in a procedure. If used in the SETUP section, it is processed only once. If used in a procedure, it is processed each time it is encountered.LOAD-LOOKUP retrieves two fields from the database, the KEY field and the RETURN_VALUE field. Rows are ordered by KEY and stored in an array. The KEY field must be unique and contain no NULL values. When the LOOKUP command is used, the array is searched (using a "binary" search) to find the RETURN_VALUE field corresponding to the KEY referenced in the lookup.

e.g.

begin-setupload-lookupname=prodstable=productsKey=product_codereturn_value=descriptionend-setup...begin-selectorder_num (+1,1)product_codelookup prods &product_code $descprint $desc (,15)from orderlinesend-select

Which is faster, a database join or LOAD-LOOKUP? It depends on your program. LOAD-LOOKUP improves performance in the following situations:· When it is used with multiple SELECTS.· When it keeps the number of tables being joined from exceeding three or four.· When the number of entries in the LOAD-LOOKUP table is small compared to the number of rows in the SELECT, and they are used often.· When most entries in the LOAD-LOOKUP table are used.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

31

Page 32: Peoplecode Question Ans

PeopleSoft HRMS

17. What is the relevance of –ZIF and –ZIV flags

-ZIF{file} Sets the full path and name of the SQR initialization file, SQR.INI.

-ZIV Invokes the SPF Viewer after generating program.spf file. This flagImplicitly invokes the -KEEP flag to create program.spf. In case ofMultiple output files, only the first report file will be passed to theViewer.

18. What prcsapi.sqc written

#INCLUDE 'PRCSAPI.SQC' ! UPDATE PROCESS REQUEST API

19. Can you override the setting in SQR

===============================Application Designer

1. What is the difference between SQL view and Query view

SQL ViewIt is SQL table created in the database which includes fields from one or more SQL tables that are reorganized into a different sequence. This provides an alternate view of information that is stored in tablesQuery ViewSelect to define the record definition as a view that is constructed using the PeopleSoft Query tool. Before you can create the view, PeopleSoft Application Designer prompts you to save the definition.This has nothing to do with PS query.It makes available to the user a template by which he can construct script simply by dragging the fields and by adding the necessary criteria..2. What is dynamic viewIt is a record definition that can be used like a view in pages and PeopleCode, but is not actually stored as a SQL view in the database. Instead, the system uses the view text as a base for the SQL Select that is performed at runtime. Dynamic views can provide superior performance in some situations, such as search records and in PeopleCode Selects, because they are optimized more efficiently than normal SQL views

3. What is the difference between Search key and Alt search key

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

32

Page 33: Peoplecode Question Ans

PeopleSoft HRMS

Key Select to identify the field as the search criteria that uniquely identifies each row. You cannot have duplicate values for primary keys.

Duplicate Order Key

Select to indicate that duplicate values can occur

Alternate Search Key

Select to identify the field as a key that provides an alternate path into the table data. Duplicate values are allowed in an alternate search key field. If you define a field as an alternate search key in a search record, when you bring up a page, the system prompts you to enter a key or alternate search key values.

Descending Key

Select to identify the field as descending if you want rows of data to be retrieved in reverse alphanumeric order (for example, 3, 2, and 1)

Search Key Select to make the field available on the basic and advanced search or lookup pages. A search key is valid only for keys and should be used only in search and prompt records. If you select this check box, the system automatically selects List Box Item

4. What is the use of List box item in record field propertiesSelect if you want the field to appear in the list box preceding a page. If a field has values in the translate table and you designate it as a list box item, the list box automatically shows the translated value instead of the code.

5. What is the length of translate value – 4

6. What is the different type of Record definitionSQL Table , SQL View , Dynamic View , Derived/Work , SubRecord , Query View, Temporary Table

7. What is the difference between Prompt table and Translate Table

Prompt table : Promt table is physical table that can be attached to certain field. Then we can select value for that field from that physical table.

Translate table : The Translate Table is a prompt table, which is similar to an all-purpose data dictionary, to store values for fields that don't need individual prompt tables of their own. As a general rule, store field values in the Translate Table if the field meets the following criteria: · Field type is Character. · Field length is 1 to 4 characters.· Field values consist of a relatively small, static set of values that are not maintained by the user.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

33

Page 34: Peoplecode Question Ans

PeopleSoft HRMS

· No other fields relate to this field.

8. What is the derived record and what is the use of itIt provides a temporary workspace to use during online page processing. A derived or work record is not stored in the database

9. What is the concept of parent-child recordIf any record has Parent record then specify parent record at record property- use tab. The keys that you establish in a parent record definition determine which keys are required in child record definitions. The child must have the same keys as the parent, plus one or more keys that uniquely identify each row.

10. What is the use of Add Search Record in component properties

This is reqd if a different search record is reqd for add actions. For example, if you selected the auto-numbering option for employee IDs (EMPLID), don’t include EMPLID in the search record. Likewise, you might want to create special security views for add actions that limit the rows that users can add, based on specific search criteria. The system default is the standard search record if you don’t specify an add search record

11. What is the difference between Sub page and Secondary page

Subpages are a powerful means of factoring out commonly used page functionality in your application. Rather than duplicating the same set of page fields on two or more pages, you can create a single subpage that contains those page fields and add it to any page. This makes it much easier to maintain the functionality these page fields represent. Subpages are even more effective when used with corresponding subrecords

While a secondary page is just another page to the user at runtime, they look and behave differently than the primary pages. For example: You can view a secondary page from its primary page only. A secondary page should have OK and Cancel buttons so that the user can dismiss the page (accepting or canceling input) and return to the primary page. To offer the user alternative buttons to dismiss the page, disable the default OK and Cancel buttons in the Page Properties dialog box.

===============================

Application Engine

1. What is the use of state record

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

34

Page 35: Peoplecode Question Ans

PeopleSoft HRMS

It is used to assign variables for Application Engine program. Also sections, steps, and actions pass values to subsequent program steps through state records.

One can have any number of state records associated with a particular Application Engine program. However, only one record can be the default state record. You can specify both work (derived) and “physical” (SQL table) records to be used as state records. The only difference is that derived state records cannot have their values saved to the database at commit time, and so the values would be lost during a restart. Therefore, PeopleSoft Application Engine erases the contents of derived state records at commit time if Restart is enabled for the current process.A PeopleSoft Application Engine state record must have a process instance defined as the first field and the only key field and the state record name must end with _AET.

2. What is the use of Temporary recordTemporary tables are used for running PeopleSoft Application Engine batch processes. Temporary tables can store specific data to update without risking the main application table.

3. What are the actions available in app engine in PS 8.8

SQL

Do (When, While, Select, Until)

PeopleCode

Call Section

Log Message

XSLT (enabled for Transform Only program types)

4. What is the structure of an application engine programSection , Step and Action

5. What is the difference between Do select and Do When

DO When

When using a Do When action, consider the following:

 The Do When action is a SELECT statement that allows subsequent actions to be executed if any rows of data are returned.

This action is similar to a COBOL “IF” statement. A Do When statement runs before any other actions in the step. If the Do When statement returns any rows, the next action is executed. If the Do When conditions are not met, the remaining actions within that step are not executed.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

35

Page 36: Peoplecode Question Ans

PeopleSoft HRMS

Your program executes a DO When action only once when the owning step executes.

The only property that you can specify for the Do When action is the ReUse Statement property, which applies to all SQL-based actions.

Do While

The Do While action is a SELECT statement that, if present, runs before subsequent actions of the step. If the Do While does not return any rows of data, the action terminates. The Do While is identical to the COBOL “WHILE” function. In other words, the subsequent actions within the step are executed in a loop as long as at least one row is returned by the SELECT statement for the DO While action. In short, if the Do While does not return any rows, the step is complete.

The only property that you can specify for the Do While action is the ReUse Statement property, which applies to all SQL-based actions.

Do Select

The Do Select action is a SELECT statement that executes subsequent actions once for every row of data that the Do Select returns. For instance, a Do Select can execute a SQL statement for each row returned from the SELECT statement. The subsequent actions within the step are executed in a loop based on the results of the SELECT statement. The type of the Do Select determines the specific looping rules.

6. Can you use Call App Engine in App engine Program Peoplecode

You can use the CallAppEngine function in a Peoplesoft Application Engine program, either directly (in a PeopleCode action) or indirectly (using a Component Interface). This functionality must be used carefully, and you should only do this once you have a clear understanding of the following rules and restrictions.

Dedicated cursors are not supported inside a "nested application engine instance" (meaning an application engine program invoked using CallAppEngine from within another application engine program). If a nested application engine instance has any SQL actions with ReUse set to Yes or Bulk Insert, those settings are ignored.

As in any other type of PeopleCode event, no commits are performed within the called application engine program. This is an important consideration. If a batch application engine program called another program using CallAppEngine, and that child program updated many rows of data, the unit-of-work might become too large, resulting in contention with other processes. A batch application engine program should invoke such child programs using a Call Section action, not CallAppEngine.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

36

Page 37: Peoplecode Question Ans

PeopleSoft HRMS

Temp tables are not shared between a batch application engine program and child program invoked using CallAppEngine. Instead, the child program is assigned an "online" temporary table instance, which is used for all temp tables in that program. In addition, if that child program invokes another program using CallAppEngine, that grandchild shares the online temp instance with the caller. In other words, only one online temp instance is allocated to a process at any one time, no matter how many nested CallAppEngine's there might be.

The lock on an online temp instance persists until the next commit. If the processing time of the called program is significant (greater than a few seconds), this would be unacceptable. As a general rule, application engine programs that make use of temp tables and have a significant processing time should be called from other application engine programs using a Call Section action, not CallAppEngine.

7. How do you Schedule the app Engine 8. what is the extension of state record.

_AET 9. Different types of Application engine Types - Standard, Upgrade, DEAMON, Transform, Import Only.

===============================

Peoplecode

1. give the sequence in which the events are fired in application processor flow

Record.Field Edit ---> Component.Record.Field Edit --->

Record.Field Change ---> Component.Record.Field Change --->

2. What is the difference between Rowset and Standalone rowset

Rowset : A rowset object is a data structure used to describe hierarchical data. It is made up of a collection of rows. A component scroll is a rowset. You can also have a level 0 rowset A level 0 rowset from a component buffer only contains one row, that is, the keys that the user specifies to initiate that component

One can use simple getrowset function.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

37

Page 38: Peoplecode Question Ans

PeopleSoft HRMS

Standalone Rowset : Standalone Rowsets are like regular Rowsets except they aren't associated with a component or page. Use them when you need to work on data that isn't associated with a component or page buffer.Standalone rowsets are not connected to the Page Processor, so there are no database updates when they are manipulated. Delete and insert activity on these types of rowsets aren't automatically applied at save time. Use Createrowset to create standalone rowset &MYRS = CreateRowset(RECORD.SOMEREC);

3. How many levels we can use on one page

Excluding level 0, there are 3 more levels (level 1, level 2, level3) that can be used on page .

4. What is component bufferWhatever data is fetched from database while populating component will

kept in temporary memory of application server i.e. called as component buffer.

the area in memory that stores data temporarily for the currently active component.

The Component Buffer consists of rows of buffer fields that hold data for the various records associated with page controls, including primary scroll records, related display records, derived/work records, and translate table records. PeopleCode can reference buffer fields associated with page controls and other buffer fields from the primary scroll record and related display records.

5. What is the use of workflow event

Workflow PeopleCode executes immediately after SavePreChange and before the database update that precedes SavePostChange. The main purpose of the Workflow event is to segregate PeopleCode related to Workflow from the rest of the application’s PeopleCode. Only PeopleCode related to Workflow (such as TriggerBusinessEvent) should be in Workflow programs. Your program should deal with Workflow only after any SavePreChange processing is complete.

6. While creating the workflow what are the three objects used

•Rules: Rules are the company’s business practices which can be captured in software. Rules determine what activities are required to process business data•Roles

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

38

Page 39: Peoplecode Question Ans

PeopleSoft HRMS

•Roles describe how people fit into the Workflow process. A role is a class of users who perform the same type of work such as managers etc.•Roles direct the work to classes of people rather than to individuals. Identifying roles instead of individual users makes the workflow more flexible and easier to maintain.•Roles remain stable even if individuals change jobs.•Routings •Routings connect the activities in the workflow. They are the system’s means of moving information from one place to another, from one step to the next.•The network of routings creates a business process from what used to be isolated activities. They get the right information to the right people at the right time, enabling users to work together to accomplish the company’s goals. Routings can take the form of an e-mail message or a worklist entry

7. What is the use of sub recordA subrecord enables you to add a group of fields that are commonly used in multiple record definitionsIt is used as Reusable component

8. What is the difference between Save prechange and save postchange event

SAVEEDIT: The SaveEdit event fires whenever the end-user attempts to save the component. You can use SaveEdit PeopleCode to validate the consistency of data in component fields. Whenever a validation involves more than one component field, you should use SaveEdit PeopleCode. If a validation involves only one page field, you should use FieldEdit PeopleCode.

An Error statement in SaveEdit PeopleCode displays a message and redisplays the component without saving data. A Warning enables the end-user to click OK and save the data, or click Cancel and return to the component without saving.

SAVEPRECHANGE : The SavePreChange event fires after SaveEdit completes without errors. SavePreChange PeopleCode provides one final opportunity to manipulate data before the system updates the database.

SAVEPOSTCHANGE :

After the Component Processor updates the database, it fires the SavePostChange event. You can use SavePostChange PeopleCode to update tables not in your component using the SQLExec built-in function.

An Error or Warning in SavePostChange PeopleCode causes a runtime error, forcing the end-user to cancel the component without saving changes. Avoid Errors and Warnings in this event.

9. What is the difference between prebuild and postbuild event

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

39

Page 40: Peoplecode Question Ans

PeopleSoft HRMS

PREBUILD : The PreBuild event fires before the rest of the component build events. This event is often used to hide or unhide pages. It’s also used to set component variables.

Note. If a PreBuild PeopleCode program issues an error or warning, the end-user is returned to the search page. If there is no search page, that is, the search record has no keys, a blank component page displays.The PreBuild event is also used to validate data entered in the search dialog, after a prompt list is displayed. For example, after the end-user selects key values on the search, the PreBuild PeopleCode program fires, which catches the error condition and issues an error message. The end-user receives and acknowledges an error message. The component is cancelled (because of the error) and the end-user is returned to the Search dialog box. PreBuild PeopleCode is only associated with components.

POSTBUILD: The PostBuild event fires after all the other component build events have fired. This event is often used to hide or unhide pages. It’s also used to set component variables.PostBuild PeopleCode is only associated with components.

10. What is page activate event does The page event set consists of a single event, the Activate event, which fires every time the page is activated.

11. Which event fire first Record field or Component record Field

Record field

12. Name of the objects used in people code The various objects used in peoplecode are SQL, Rowsets, Records, Messages, Arrays

13. How do you open the secondary page using the peoplecode

Using DoModal Function. The syntax is specified below : &RC= DoModal(Panel.PCS_PRJ_RES_PO_SBP, "Purchase Order Details", - 1, - 1); where -1, -1 stands for center alignment.

14. What is the use of effective data

15. How many rows SQLEXEC returnOne.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

40

Page 41: Peoplecode Question Ans

PeopleSoft HRMS

16. What does the Setcursorpos doSetCursorPos places the focus in a specific field anywhere in the current component.

17. Have u debug the Peoplecode?? Explain it

The PeopleCode Debugger is an integrated part of PeopleSoft Application Designer. The interface to the Debugger has a visual indicator of breakpoints, an arrow indicating the current line and the ability to step through code. You can inspect the value of a variable by ‘hovering’ your cursor over it and reading the pop-up bubble help. The Debugger also provides variable inspection windows for Globals, Locals, Function Parameters, and Component scoped variables. It also enables PeopleCode objects to be "expanded", so you can inspect their component parts.

Also the developer can save the trace file that is generated during execution provided the debugging parameters are set rightly.

18. What is the difference between Field change and Fieldedit event and which fire first

Field Edit:FieldEdit PeopleCode is used to validate the contents of a field, supplementing the standard system edits. If the data does not pass the validation, the PeopleCode program should display a message using the Error statement, which redisplays the page, displaying an error message and turning the field red

Field ChangeFieldChange PeopleCode is used to recalculate page field values, change the appearance of page controls, or perform other processing that results from a field change other than data validation. To validate the contents of the field, use the FieldEdit event

Field Edit fires first

List of Events :

Field Component Record Field

Component Record

Component Page Menu

FieldChangeFieldDefaultFieldEditFieldFormula

FieldChangeFieldDefaultFieldEditPrePopup

RowDeleteRowInitRowInsertRowSelect

PostBuildPreBuildSavePostChg

Activate

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

41

Page 42: Peoplecode Question Ans

PeopleSoft HRMS

Field Component Record Field

Component Record

Component Page Menu

PrePopupRowDeleteRowInitRowInsertRowSelectSaveEditSavePostChgSavePreChgSearchInitSearchSaveWorkflow

SaveEditSavePostChgSavePreChgSearchInitSearchSave

SavePreChgWorkflow

Sequence of Execution of events :

Recordwise Field wise FieldEdits and then Related Component Recordwise Fieldwise FieldEdits

Recordwise Field wise FieldChgs and then Related Component Recordwise Fieldwise FieldChg

Recordwise Field wise SaveEdits and then Related Component Recordwise Fieldwise SaveEdits

Recordwise Field wise SavePreChg and then Related Component Recordwise Fieldwise SavePreChg

Recordwise Field wise Workflow and then Related Component Recordwise Fieldwise Workflow

Recordwise Field wise SavePostChg and then Related Component Recordwise Fieldwise SavePostChg

1. What is the use of component Interface

A component interface enables exposure of a PeopleSoft component (a set of pages grouped together for a business purpose) for synchronous access from another application (such as PeopleCode, Java, C/C++, COM, or XML).

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

42

Page 43: Peoplecode Question Ans

PeopleSoft HRMS

A component interface maps to one, and only one, PeopleSoft component. A component interface is created in the PeopleSoft Application Designer. Record fields on the PeopleSoft component are mapped to the keys and properties of the component interface. Methods are used to find, create, modify or delete data.

2. What are the method available in CI A method is a function that performs a specific task on a component interface at runtime. There are two types of methods available as

Standard method : that are available for all component interfaces. They are as follows Find, Get, Save, and Cancel method

User-defined methods : are created in PeopleSoft Application Designer to provide added functionality to the component interface. These methods are functions that are made accessible through the component interface. Each function maps to a user-defined method.

3. Can you define your own methodYES

4. How do you connect PS using CI

5. What do mean by session object

6. What is the collection

A collection is a property that points to a scroll, rather than a field, in the underlying component for a component interface. A collection groups multiple fields in a scroll. All the fields in the scroll are mapped to a property. These properties are part of the collection.

You create collections the same way you create properties—drag the scroll from the component view into the component interface view. Consider these points when creating collections:

When dragging a scroll into the component interface view, all child scrolls come with it.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

43

Page 44: Peoplecode Question Ans

PeopleSoft HRMS

7. What is the difference between Runtime plugin and design time plugin

=============================

01. What difference is there in AE75 and AE84?a. In 7.5 AE is the separate tool where in 8.4 it is a part of application

designer i.e. Object.b. In 8.4, you can associate peoplecode with Application engine.c. In 8.4, you can access all application designer objects from Application

Engine

02. What is the purpose of temporary record and state record?Temporary record: Temporary tables are used for running PeopleSoft Application Engine batch processes. Temporary tables can store specific data to update without risking the main application table.

State record : It is used to assign variables for Application Engine program. Also sections, steps, and actions pass values to subsequent program steps through state records. In a state record only a unique line is stored for a process instance.

03. What the events of components and when /why are they used?

Total 5 event are there in component. There flow of execution are as followes:

PreBuild This event is often used to hide or unhide pages. It’s also used to set component variablesPostBuild The PostBuild event fires after all the other component build events have fired. This event is often used to hide or unhide pages. It’s also used to set component variablesSavePreChg The SavePreChange event fires after SaveEdit completes without errors. SavePreChange PeopleCode provides one final opportunity to manipulate data before the system updates the database

Workflow Workflow PeopleCode executes immediately after SavePreChange and before the database update that precedes SavePostChange. The main purpose of the Workflow event is to segregate PeopleCode related to Workflow from the

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

44

Page 45: Peoplecode Question Ans

PeopleSoft HRMS

rest of the application’s PeopleCode. Only PeopleCode related to Workflow (such as TriggerBusinessEvent) should be in Workflow programsSavePostChg After the Component Processor updates the database, it fires the SavePostChange event. You can use SavePostChange PeopleCode to update tables not in your component using the SQLExec built-in function

04. Why use work records when we have variables?

Variables are used when only single set of data is requied to access.But if multiple rows of data is required, then work record can be used.

work record is by default declared globally whereas a variable is a temporary memory allocation and scope of the same can be Local or global.

Variables hold the values until the program ends or the component is changes where work record can hole multiple rows of data and it is available across all events.

( Work record:temporary workspace to use during online page processing. A derived or work record is not stored in the database, so you do not build Work records.Work record can also used to attach to PushButton and hyperlink or objects )

05. What does session object signify in the CI? it connects CI to a session on peoplesoft application serve. You can multiple session objects while connecting PS to third party application.

%Session returns a reference to the current, existing session. If you use %Session successfully, you don't have to use the GetSession function and Connect method. If you don't have a current session, %Session returns NULL.

What are the various append modes for a file?how will you append in the beginning?

06. What is the difference between Do Select & a Do When?a. Do select is loop and Do when is like if condition.

07. In a Do Select when using a Restartable AE what care should be taken by the programmer while writing the code? Use Re-Select type of Do select.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

45

Page 46: Peoplecode Question Ans

PeopleSoft HRMS

08. Can work records be used in a Reselect? No.

09. Can we make use of work records and still make it restartable?a. No.

10. Use of SQLExec?

The SQLExec function executes a SQL command from within a PeopleCode program by passing a SQL command string. The SQL command bypasses the Component Processor and interacts with the database server directly. If you want to delete, insert, or update a single record, use the corresponding PeopleCode record object method.

statement returns only one row.

11. What is dynamic view?Dynamic view can be used like a sql view in pages and PeopleCode, but is not actually stored in the databaseDynamic view is temporary view created at run time dynamically for processing.

12. If you get an error in SQR log Inspite of you getting the report output; what type of error is it & why?

13. Export & Import of data via AE? (Have u done it anywhere)

14. How to refer a field value in Scroll level three?

&FLD2 = GetLevel0().GETROW(1).GetRowset(Scroll.PCS_BSS_LVL_R).GETROW(1).GetRowset(Scroll.PCS_BSS_LVL_R1).GetRow(1). GetRowset(Scroll.PCS_BSS_LVL_R2).GETROW(&I).GetRecord(Record.PCS_BSS_LVL_R2).GetField(Field.ADDRESS);

15. Name the joins used in SQL?Inner Joins, Outer Joins, Self J

16. Sequence of execution of events in PeopleCode?a. SearchInit, SearchSave, RowSelect, PreBuild, FieldDefault, FieldFormula,

RowInit, PostBuild, Activate

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

46

Page 47: Peoplecode Question Ans

PeopleSoft HRMS

b. RowInsert, RowDelete, SaveEdit, SavePreChange, Workflow, SavePostChange, PrePopup, ItemSelected.

17. Field Length of Translate value?a. Field Length – 4

18. Use of effective date?a. To maintain present, past and history data.

19. Types of tables are allowed as a state records in AE.a. SQL Table, Derived work record where name ending with AET.

20. Which fields will be loaded into component buffer if a component is opened? i.e. if there are 10 fields in a record and only 3 fields are placed on the page then all the remaining fields will be available in the component buffer or only those fields which are placed on the component?

a. All fields will be available in component buffer. For search record only those fields which are there in search dialog.

21. How to retrieve/assign a record field, which is not placed in the component?

Using Createsql n createrecord n sqlexec function .

The CreateSQL function create a SQL object from the SQL class and opens it on the given sqlstring and input values. That sql object can be used with array or with fetch stmt to access the value.

e.g.

&Sql1 = CreateSql("Select * from " | &TableName); &AAny = CreateArrayAny(); While &Sql1.Fetch(&AAny) /* Process the row in &AAny. */ ... End-While;

CreateRecord creates a standalone record definition and its component set of field objects. The specified record must have been defined previously, that is, it

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

47

Page 48: Peoplecode Question Ans

PeopleSoft HRMS

must have a record definition. However, if you are calling this function from PeopleCode associated with a page, the record does not have to be included on the current page

22. Types of SQL objects used in peoplecode?a.

23. Difference between the 7.5 and 8.4 in security aspect?a. Role is main layer added in 8.4

24. Name the objects used in peoplecode?a. RowSet, Row, SQL, RecordSet

25. When can you attach PeopleCode with a push button? What are the events that are triggered with a push button action?

When a Push Button is tagged to a derived record peoplecode can be llinked to it.

recordfield field change event is triggered with a push button action.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

48

Page 49: Peoplecode Question Ans

PeopleSoft HRMS

HRMS

1.What are the Major changes in 7.5 and 8.8 PeopleTools.2.HRMS Data flow.3.Recruit WorkForce Dataflow.4.What is SETID and Business Unit.5.What is the use of Structured ID in Tree Manager.6.Moment you Enter Business unit what are the other fields get defaulted7. How do you build the Departmental Security8 What is the Permission List and Role?9.How do give the access to page10. What is the primary permission List in HRMS 8.811.After Building the tree, which is the process you need to run.12.what are the three steps to setting up the employee data security

Security –

Row-Level Security

With row-level security, users can have access to a table without having access to all rows on that table. This type of security is typically applied to tables that hold sensitive data. For example, you might want users to be able to review personal data for employees in their own department, but not for people in other departments. You would give everyone access to the PERSONAL_DATA table, but would enforce row-level security so that they could only see rows where the DEPTID matches their own.

SQR

20. What are the common SQC’s used in Report21. How many section are available in SQR22. Which is the Required Section in SQR23. What is difference between Begin-Report and Begin-Program.24. Can you write Select statement in Begin-SQL Section25. How do you call the procedure in SQR26. What is the difference between Display and Show command27. Can you print the result on one line using Display command.28. What are the parameters required to connect the database using SQR29. Can you tell us the SQR report execution flow using Process Scheduler.30. What are the type of variable used in SQR31. What is the difference between LET and MOVE command32. What is the use of ON-BREAK.33. What is the purpose of -F flag and –O flag34. What is the difference between ASK and INPUT command.35. What is Load-Lookup

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

49

Page 50: Peoplecode Question Ans

PeopleSoft HRMS

36. What is the relevance of –ZIF and –ZIV flags37. What prcsapi.sqc written38. Can you override the setting in SQR

Application Designer12. What is the difference between SQL view and Query view13. What is dynamic view14. How to build the Record15. What is the difference between Search key and Alt search key16. What is the use of List box item in record field properties17. What is the length of translate value

18.What is the different type of Record definition (7)

SQL Table

SQL View

Dynamic View

Derived/Work

SubRecord

Query View

Temporary Table

19.What is the difference between Prompt table and Translate Table

Prompt table : Promt table is physical table that can be attach to certain field. Then we can select value for that field from that physical table.

Translate table : The Translate Table is a prompt table, which is similar to an all-purpose data dictionary, to store values for fields that don’t need individual prompt tables of their own. As a general rule, store field values in the Translate Table if the field meets the following criteria:

Field type is Character.

Field length is 1 to 4 characters.

Field values consist of a relatively small, static set of values that are not maintained by the user.

No other fields relate to this field.

20.What is the derived record and what is the use of it

Select to define the record definition as a temporary workspace to use during online page processing. A derived or work record is not stored in the database, so you do not build it.

21.What is the concept of parent-child record

If any record has Parent record the specify parent record at record property- use tab. The keys that you establish in a parent record definition determine which keys are required in child record definitions. The child must have the same keys as the parent, plus one or more keys that uniquely identify each row.

22.What is the use of Add Search Record in component properties

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

50

Page 51: Peoplecode Question Ans

PeopleSoft HRMS

23.What is the difference between Sub page and Secondary page24.Name the some page control

Application Engine9. What is the use of state record10. What is the use of Temporary record11. What are the actions available in app engine in PS 8.812. What is the difference between 7.5 app engine debugger and 8.8 Debugger13. What is the structure of an application engine program14. What is the difference between Do select and Do When15. Can you use Call App Engine in App engine Program Peoplecode16. How do you Schedule the app Engine17. what is the extension of state record.

Peoplecode19. give the sequence in which the events are fired in application processor flow20. What is the difference between Rowset and Standalone rowset21. How many levels we can use on one page22. What is component buffer23. What is the use of workflow event24. While creating the workflow what are the three objects used25. What is the use of sub record26. What is the difference between Save prechange and save postchange event 27. What is the difference between prebuild and postbuild event28. What is page activate event does29. Which event fire first Record field or Component record Field30. Name of the objects used in people code31. What is the difference between the 7.5 and 8.8 security aspects32. How do you open the secondary page using the peoplecode33. What is the use of effective data34. How many rows SQLEXEC return35. What does the Setcursorpos do36. Have u debug the Peoplecode?? Explain it37. What is the difference between Field change and Fieldedit event and which fire first38.

Miscellaneous8. What is the used of component Interface9. What are the method available in CI10. Can you define your own method11. How do you connect PS using CI12. What do mean by session object13. What is the collection14. What is the difference between Runtime plugin and design time plugin

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

51

Page 52: Peoplecode Question Ans

PeopleSoft HRMS

CAP&GEMs

What difference is there in AE75 and AE84?What is the purpose of temperory record and state record?What the events of components and when /why are they used?Why use work records when we have variables?What does session object signify in the CI?What are the various append modes for a file?how will you append in the beginning?What are the common sqc's? why are they used?Written any SQR processess?What is the difference between Do Select & a Do When?In a Do Select when using a Restartable AE what care shoud be taken by the programme while writting the code?Can work records be used in a Reselect?Have you done debugging of an application Engine?Can we make use of work records and sil make it restartable?+++++++++++++++++++++++++++++++++++++++++++++++++CHECK OUT MORE QUESTIONS INCLUDING ABOVE ONCE AND ALMST ALL ANSWERED..PLEASE BE CAREFUL

01. What difference is there in AE75 and AE84?a. In 7.5 AE is the separate tool where in 8.4 it is a part of application designer i.e. Object.b. In 8.4, you can associate peoplecode with Application engine.c. In 8.4, you can access all application designer objects from Application Engine

02. What is the purpose of temporary record and state record?a. Temporary record is generally used in processing of data on large volumes.b. State record is like variables which contain only one row of data and used to pass

values from one section to another section.

03. What the events of components and when /why are they used?a. FieldEdit, FieldChange, SavePreChange, SavePostChange. These events are used to

write component specific code.

04. Why use work records when we have variables?a. Variables hold the values until the program ends or the component is changes where

work record can hole multiple rows of data and it is available across all events.b. Work records can also used to attach to PushButton and hyperlink or objects.

05. What does session object signify in the CI?a. Session objects are used to connect CI with PS application. You can multiple session

objects while connecting PS to third party application.

06. What are the various append modes for a file? How will you append in the beginning?a. Never come across using FILES.

07. What are the common SQC's? Why are they used?a. Setenv.sqc, setdec32.sqc, sqrtrans.sqc, prcsapi.sqc, prcsdef.sqc, reset.sqc,

curdttim.sqc, datetime.sqc, number.sqc, readxlat.sqc, datemath.sqc.08. Written any SQR processes?a. Yes

09. What is the difference between Do Select & a Do When?a. Do select is loop and Do when is like if condition.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

52

Page 53: Peoplecode Question Ans

PeopleSoft HRMS

10. In a Do Select when using a Restartable AE what care should be taken by the programmer while writing the code?

a. Use Re-Select type of Do select.

11. Can work records be used in a Reselect?a. No.

12. Have you done debugging of an application Engine?a. Yes.

13. Can we make use of work records and still make it restartable?a. No.

14. What is Component Buffer?a. Whatever data is fetched from database while populating component will kept in

temporary memory of application server i.e. called as component buffer.

15. Use of SQLExec? a. SQL Exec is used to perform DML operations but SELECT statement returns only one

row.

16. What is dynamic view?a. Dynamic view is temporary view created at run time dynamically for processing.

17. If you get an error in SQR log Inspite of you getting the report output; what type of error is it & why?

18. What is the difference between FieldChange and FieldEdit?a. FieldEdit executes to validate new value in field where FieldChange does processing for

new value entered.

19. What is Page Activate Event?a. Page activate is fired every time the page is get focused.

20. How many scrolls can there be on a page?a. Three

21. What is a prompt table?a. Prompt table is to get valid data.

22. Actions in Application engine. Different types of application engines?a. Actions- PeopleCode, Do when, Do select, Do While, Do Until, SQL, Call Section, XSLT,

Message Logb. Types - Standard, Upgrade, DEAMON, Transform, Import Utility.

23. Export & Import of data via AE? (Have u done it anywhere)a. No.

24. How to refer a field value in Scroll level three?

25. Name the joins used in SQL?a. Inner Joins, Outer Joins, Self J

How many sections

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

53

Page 54: Peoplecode Question Ans

PeopleSoft HRMS

which is the mandatory cna u write sqr using single section and which

what is break?

can u have multiple heading in sqr 1 heading but 1 header section

How to call diff processes or sqr from sqr.

=====================================================================01. What difference is there in AE75 and AE84?a. In 7.5 AE is the separate tool where in 8.4 it is a part of application designer i.e. Object.b. In 8.4, you can associate peoplecode with Application engine.c. In 8.4, you can access all application designer objects from Application Engine

02. What is the purpose of temporary record and state record?a. Temporary record is generally used in processing of data on large volumes.b. State record is like variables which contain only one row of data and used to pass values

from one section to another section.

03. What the events of components and when /why are they used?a. FieldEdit, FieldChange, SavePreChange, SavePostChange. These events are used to

write component specific code.

04. Why use work records when we have variables?a. Variables hold the values until the program ends or the component is changes where

work record can hole multiple rows of data and it is available across all events.b. Work records can also used to attach to PushButton and hyperlink or objects.

05. What does session object signify in the CI?a. Session objects are used to connect CI with PS application. You can multiple session

objects while connecting PS to third party application.

06. What are the various append modes for a file? How will you append in the beginning?a. Never come across using FILES.

07. What are the common SQC’s? Why are they used?a. Setenv.sqc, setdec32.sqc, sqrtrans.sqc, prcsapi.sqc, prcsdef.sqc, reset.sqc,

curdttim.sqc, datetime.sqc, number.sqc, readxlat.sqc, datemath.sqc.08. Written any SQR processes?a. Yes

09. What is the difference between Do Select & a Do When?a. Do select is loop and Do when is like if condition.

10. In a Do Select when using a Restartable AE what care should be taken by the programmer while writing the code?

a. Use Re-Select type of Do select.

11. Can work records be used in a Reselect?a. No.

12. Have you done debugging of an application Engine?a. Yes.

13. Can we make use of work records and still make it restartable?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

54

Page 55: Peoplecode Question Ans

PeopleSoft HRMS

a. No.

14. What is Component Buffer?a. Whatever data is fetched from database while populating component will kept in

temporary memory of application server i.e. called as component buffer.

15. Use of SQLExec? a. SQL Exec is used to perform DML operations but SELECT statement returns only one

row.

16. What is dynamic view?a. Dynamic view is temporary view created at run time dynamically for processing.

17. If you get an error in SQR log Inspite of you getting the report output; what type of error is it & why?

18. What is the difference between FieldChange and FieldEdit?a. FieldEdit executes to validate new value in field where FieldChange does processing for

new value entered.

19. What is Page Activate Event?a. Page activate is fired every time the page is get focused.

20. How many scrolls can there be on a page?a. Three

21. What is a prompt table?a. Prompt table is to get valid data.

22. Actions in Application engine. Different types of application engines?a. Actions- PeopleCode, Do when, Do select, Do While, Do Until, SQL, Call Section, XSLT,

Message Logb. Types - Standard, Upgrade, DEAMON, Transform, Import Utility.

23. Export & Import of data via AE? (Have u done it anywhere)a. No.

24. How to refer a field value in Scroll level three?

25. Name the joins used in SQL?a. Inner Joins, Outer Joins, Self Join

26. How to open a secondary page through the PeopleCode? And how to refer the fields in the secondary page?

a. Do Model, Pushbutton, Hyperlink.

27. Sequence of execution of events in PeopleCode?a. SearchInit, SearchSave, RowSelect, PreBuild, FieldDefault, FieldFormula, RowInit,

PostBuild, Activateb. RowInsert, RowDelete, SaveEdit, SavePreChange, Workflow, SavePostChange,

PrePopup, ItemSelected.

28. Field Length of Translate value?a. Field Length – 4

29. Difference between prompt table and translate table?

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

55

Page 56: Peoplecode Question Ans

PeopleSoft HRMS

a. Prompt table get the list from Physical table or view, which can be updated from front end.

b. Translate table lists the pre-defined values for that field.

30. Use of effective date?a. To maintain present, past and history data.

31. Types of tables are allowed as a state records in AE.a. SQL Table, Derived work record where name ending with AET.

32. Which fields will be loaded into component buffer if a component is opened? i.e. if there are 10 fields in a record and only 3 fields are placed on the page then all the remaining fields will be available in the component buffer or only those fields which are placed on the component?

a. All fields will be available in component buffer. For search record only those fields which are there in search dialog.

33. How to retrieve/assign a record field, which is not placed in the component?a. Record.RECORDNAME.FieldName.FieldValue

34. Types of SQL objects used in peoplecode?a.

35. Difference between the 7.5 and 8.4 in security aspect?a. Role is main layer added in 8.4

36. Name the objects used in peoplecode?a. RowSet, Row, SQL, RecordSet

PEOPLECODEPEOPLE CODE

There are six general areas where application processor performs peoplecode.

1) During the search process2) Before panel displays3) After field changes4) After row inserts and row deletes5) After saves6) Processing pop up menus

Where peoplecode is stored?

Record definitions do not contain the PeopleCode itself. They instead contain references to special tables that store PeopleCode. When you save your record definition containing PeopleCode, the system creates a link between the fields on that record definition and the PeopleCode tables.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

56

Page 57: Peoplecode Question Ans

PeopleSoft HRMS

PeopleCode is stored in binary form on a PeopleTools table, PSPCMPROG, which is related to the record field definition (PSRECFIELD) and menu item definition (PSMENUITEM) tables.

Think-time" functions

"Think-time" functions suspend processing either until the user has taken some action (such as clicking a button in a message box), or until an external process has run to completion (for example, a remote process).

Think-time functions should be avoided in any of the following PeopleCode events:

· SavePreChange · Workflow· RowSelect· SavePostChange

Violation of this rule can result in application failure.

The following are think-time functions in PeopleTools:

· DoModal· Prompt· RemoteCall· DoModalPanelGroup· WinMessage and MessageBox (depending on style parameter)

System variables are preceded by a percent “%” symbol whenever they appear in a program.

You can use these variables to get the current date and time, information about the operator, the current language, the current record, panel, or panel group, and more.

Operations on Dates and Times

You can add or subtract two date values or two time values, which gives you a NUMBER result.

In the case of dates, the number represents the difference between the two dates in days.

In the case of time, the number represents the difference in seconds.

DoModal

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

57

Page 58: Peoplecode Question Ans

PeopleSoft HRMS

The DoModal function displays a secondary panel.

PeopleCode Events

1. SearchInit PeopleCode

SearchInit PeopleCode is performed before the search record dialog box is displayed. It provides a way to control processing before an operator enters values in the search key & alternate search key fields.

SearchInit for a search record dialog box is similar to RowInit for a panel.

2. SearchSave PeopleCode

SearchSave PeopleCode is performed after the operator selects the OK button in the search record dialog box. The most common use of this PeopleCode event is to force the operator to input at least one field into the dialog box. Since a list box can only display 300 items, this helps narrow the search for tables with many rows of data.

3. RowSelect PeopleCode

RowSelect PeopleCode is performed as the application processor reads data into the panel group.

Component Record Field Event Set

The following events can be associated with a component record field:

FieldChange Event FieldDefault Event

FieldEdit Event

PrePopup Event

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

58

Page 59: Peoplecode Question Ans

PeopleSoft HRMS

Component Event Set

The following events can be associated with a component:

PostBuild Event PreBuild Event

SavePostChange Event

SavePreChange Event

Workflow Event

Overriding the Search Record

You might want to reuse a component, changing only its search record.

You can accomplish this by overriding the component search record at the time that the component is invoked from a menu. To override a component search record, specify a different search record in the properties of the menu item that invokes the component. The component uses the override search record when it is invoked from that specific menu item; the search record set in the component properties remains unchanged.

By reusing components in this way, you can limit redundancy, keeping your application smaller and easier to maintain.

PEOPLESOFT INTERNET ARCHITECHTURE

PeopleSoft Pure Internet Architecture

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

59

Page 60: Peoplecode Question Ans

PeopleSoft HRMS

Database ServerThe database server houses a database engine and your PeopleSoft application database, which includes all the application's object definitions, system tables, application tables, and data. The database server must be running one of the PeopleSoft-supported RDBMS and operating system combinations.

A single database server can have multiple application servers connecting to it. The database server simultaneously handles the application server connections, development environment connections, and batch programs running against it.

APPLICATION ENGINE

For standard program definitions, the MAIN section is always displayed first (Library program types do not contain a MAIN section because they contain only callable sections).

The remaining sections appear alphabetically by name, which makes it easier to locate a section within the program definition. The system, at runtime, executes sections through Call Section actions within steps, not by the order in which sections are defined.

Steps are never automatically reordered in Definition view, and, at runtime, they execute in the sequence in which you define them.

Actions are always logically reordered within a step, based on their action type, which defines their runtime sequence

Select state records for use with a particular program. Click Add to include selected records from the record list into the selected list. Click Remove to remove selected records from the selected list. Indicate which state record to act as the default state record by selecting its check box. For your default state record, you need to reference only fieldnames in your PeopleCode and SQL (for the active program). When you reference a non-default state record, you do so by using recname.fieldname

PeopleSoft Application Engine expects Temporary Table records to contain the PROCESS_INSTANCE field

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

60

Page 61: Peoplecode Question Ans

PeopleSoft HRMS

Select for batch-only programs. Batch-only programs are not executed from the CallAppEngine PeopleCode function. Any dedicated temporary table used for batch-only programs do not have online instances created.

Enabled only when a step contains one of the following actions: Do While, Do Select, or Do Until. Enter the numeric frequency with which PeopleSoft Application Engine should commit. If non-zero, PeopleSoft Application Engine commits every N iterations, and then again after the last iteration

You cannot have more than one action of a specific type within the same step.

You cannot have a SQL action and a Call Section action within the same step.

A Do When statement runs before any other actions in the step. If the Do When statement returns any rows, the next action is executed. If the Do When conditions are not met, the remaining actions within that step are not executed. Your program executes a Do When action only once when the owning step executes

Do Select Type Property

When you specify the Do Select Type property in a Do Select action, you choose from the following values:

Select/Fetch PeopleSoft Application Engine opens a cursor for the Do Select action, then, within that cursor, PeopleSoft Application Engine performs a Fetch statement for each iteration of the loop to get each row from the Select statement. When a Fetch statement results in an end of table message, the looping is complete. You can’t restart this type of Select statement, because PeopleSoft Application Engine does not perform a checkpoint or a commit within the step containing this action while Select/Fetch is running. Ultimately, your program ignores the commit settings at runtime until the outermost Select/Fetch completes.

Note. When an Application Engine program is not set up for restartability, then commits are not controlled, monitored, or restricted by PeopleSoft Application Engine. When Restart is disabled, commits are controlled by the program.

Re-Select For each iteration of the loop, PeopleSoft Application Engine opens a cursor and fetches the first row. Your program processes the first row returned from the Select statement. The cursor is reopened for each iteration of the loop. With this type of Fetch statement, you typically want some aspect of the loop to eventually cause the Select statement to return no rows. Otherwise, there is no mechanism in place by which to exit the loop. This type of Do Select is restartable.

Restartable This option is similar to Select/Fetch in that PeopleSoft Application Engine opens the cursor associated with the Do Select action once, and then it performs a Fetch statement on each iteration of the loop to get each row from the Select statement. However, unlike the Select/Fetch option, you can restart this action, because PeopleSoft Application Engine performs a checkpoint in the middle of the step. PeopleSoft Application Engine treats this loop as if it is restartable, but it does not manage the restart. Make sure that the SQL you include within this action is such that, upon restart, the program recognizes where the previous run failed and where to restart processing. For example, you can employing a processed switch, or base the next Select statement on the key.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

61

Page 62: Peoplecode Question Ans

PeopleSoft HRMS

Setting CommitsFor new Application Engine programs that you develop, by default, the commit values at the section and the step level are turned off. No commits occur during the program run, except for the implicit commit that occurs after the successful completion of the program.

It’s up to you to divide your program into logical units of work by setting commit points within your program. Typically, after PeopleSoft Application Engine completes a self-contained task, it might be a good time to commit. How often you apply commits affects how your program performs in the event of a restart. For set processing programs, commit early and often. For row-based processing, commit after every N iterations of the main fetch loop that drives the process.

If you have a step with a Do While, Do Until, or a Do Select action, you can set the frequency option, which drives your commit level. This enables you to set a commit at the step level that occurs after a specified number of iterations of your looping construct. Application Engine programs commit whenever they are instructed to do so, so you can enable the frequency option as well as have other individual commits inside of a loop.

The only restriction for batch runs occurs when you have restart enabled, and you are inside a Do Select action that is of the Select/Fetch type (instead of Re-select or Restartable). With Select/Fetch, all commits inside the loop are ignored, including the commit frequency if it's set.

The Restartable option is similar to Select/Fetch, except that you are implying to PeopleSoft Application Engine that your SQL is structured in such a way that it filters out rows that have been processed and committed. This enables a successful restart. One technique for accomplishing this is to have a processed flag that you check in the Where clause of the Do Select action, and you perform an update inside the loop (and before the commit) to set the flag to Y on each row that you fetch.

The commit logic is designed to perform a commit regardless of whether any database changes have occurred. The program commits as instructed, except when the program is restartable and at a point where a commit would affect restart integrity—inside a non-restartable Do Select action, for example.

When you set a step to commit by default, it means that the step's commit frequency is controlled by the section's auto commit setting. If the section is set to commit after every step, then the program commits. Otherwise, the program never commits unless the step is explicitly set to commit afterward.

Scope of Variables

State record (work record)

Transaction (unit of work)

Using a work record as your Application Engine state record means that the values in the work record cannot be committed to the database. Commits happen as directed, but any values in work records are not retained after a commit.

State record (database record)

Application Engine program

Using a database record as your Application Engine state record preserves the values in the state record on commit, and the committed values are available in the event of a restart.

Local PeopleCode variables

PeopleCode program

Local PeopleCode variables are available only for the duration of the PeopleCode program that is using them.

Global PeopleCode variables

Application Engineprogram

Global PeopleCode variables are available during the life of the program that is currently running. Any global PeopleCode variables are saved when an Application Engine program commits and checkpoints, and therefore they are available in the event of a restart.

Component PeopleCode variables

Application Engine program

Component PeopleCode variables act like global variables to PeopleSoft Application Engine.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

62

Page 63: Peoplecode Question Ans

PeopleSoft HRMS

CallAppEngine

make synchronous online calls to an Application Engine program, use the PeopleCode function CallAppEngine.

Using the CommitWork Function

This function commits pending changes (inserts, updates, and deletes) to the database. Keep the following in mind when using CommitWork:

If the program is invoked by CallAppEngine, the CommitWork function is ignored. The same is true for commit settings at the section or step level.

Online Execution Batch Execution

Started by the CallAppEngine function from PeopleCode.

Started through PeopleSoft Process Scheduler.

Program runs quickly, synchronously, and at random times.

Programs run for longer amounts of time, asynchronously, and at scheduled times.

Potential for simultaneous execution. Can be designed for parallel execution for performance.

Uses the online temporary table pool. Uses the batch/dedicated temporary table pool.

Do not use CallAppEngine within an Application Engine PeopleCode step. If you need to call an Application Engine program from another Application Engine program, you must use the Call Section action.

Restarting Application Engine ProgramsOne key feature of PeopleSoft Application Engine is its built-in checkpoint and restart capabilities. If there is an abnormal termination or failure on a step in the program, you can restart the request from the last successful checkpoint, or the step immediately preceding the step that failed. You restart the program from the process request page.

This section provides an overview of restart and discusses how to:

Determine when to use restart.

Control abnormal terminations.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

63

Page 64: Peoplecode Question Ans

PeopleSoft HRMS

Restart Application Engine programs.

Start Application Engine programs from the beginning.

Enable and disable restart.

Understanding Restart

Application Engine programs save to the database (perform a commit) only when an entire program successfully completes. You must set any individual commits where appropriate.

At the section level, you can set a commit after each step in that section. At the step level, you can require or defer commits for individual steps, or you can increase the commit frequency within a step to N iterations of a looping action within a step, such as a Do Select or Do While action.

The commit level that you select plays a major role in how restart works in a program. Each time that PeopleSoft Application Engine issues a commit with restart enabled, it records the current state of the program. The recording of the current state that PeopleSoft Application Engine performs is referred to as a checkpoint.

With restart, if a failure occurs at any point in the process, the user can restart the program and expect the program to behave in the following manner:

Ignore the steps that have already completed up to the last successful commit.

Begin processing at the next step after the last successful commit.

The ability for PeopleSoft Application Engine to“remember completed steps depends on a record called AERUNCONTROL, which is keyed by process instance.

When a program runs, each time PeopleSoft Application Engine issues a commit it also saves all of the information required for a program restart in the AERUNCONTROL record.

Using Restart at the Section Level

The section level property associated with restart is section type, which has the options Prepare Only and Critical Updates.

If a section is only preparing data, as in selecting it, populating temporary tables, or updating temporary tables, then set the section type to Prepare Only. However, if the section updates permanent application tables in the database, set the option to Critical Updates.

During runtime, when the system arrives at the first section set to Critical Updates, it sets the AE_CRITICAL_PHASE value in the AERUNCONTROL record to Y. Once set, the value of AE_CRITICAL_PHASE remains Y until the program completes successfully. When the program completes, the corresponding row in AERUNCONTROL is deleted. Therefore, a Prepare Only section following the Critical Updates section won’t reset the AE_CRITICAL_PHASE value to N.

If your program terminates, the user can check the AE_CRITICAL_PHASE value. If it’s Y. the user knows that the section that failed is critical and that the program should be restarted to ensure data integrity. If

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

64

Page 65: Peoplecode Question Ans

PeopleSoft HRMS

AE_CRITICAL_PHASE is N, restarting may not be necessary; however, as a general rule, you should restart even if AE_CRITICAL_PHASE is set to N

A Do Select action that has been coded for Restartable can be converted to Select/Fetch, but the opposite is not true

Restarting Application Engine Programs

There are two ways to restart an Application Engine program:

From the command line.

From a process request page.

Understanding Tracing Application Engine ProgramsYou can set the following traces to monitor the performance of Application Engine programs:

Application Engine step trace.

Application Engine SQL trace.

Application Engine statement timings trace.

Database optimizer trace.

Component Interfaces

Every component interface has the following main attributes:

Name. Keys (get keys, create keys, and find keys).

Properties and collections (GetHistoryItems,EditHistoryItems,InteractiveMode)

Methods ( Find,Get,Save,Cancel)

Create keys are produced only if the underlying component is able to run in Add mode (the example preceding this procedure does not have Create keys, because the search record of the underlying component cannot run in Add mode).

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

65

Page 66: Peoplecode Question Ans

PeopleSoft HRMS

The standard methods Cancel, Find, Get, and Save are automatically created. The Create method is not automatically created unless the component supports the Add mode.

Understanding Keys

The following table shows the three type of component interface keys.

Key Type

Key Characteristics

Get keys

These keys automatically map to search key fields in the search record for the underlying component. You must change Get keys only if you modify the keys of the component after you create a component interface.

Find keys

These map to both search key fields and alternate search key fields in the search record for the underlying component. You may remove any Find keys based on alternate search key fields that you don’t want to make available for searching.

Create keys

If the underlying component allows the Add action, then Create keys are generated for the component interface automatically. They map to fields marked as Srch (search) in the search record for the component (or the add search record, if one is specified).

Working With CollectionsA collection is a property that points to a scroll, rather than a field, in the underlying component for a component interface. A collection groups multiple fields in a scroll. All the fields in the scroll are mapped to a property. These properties are part of the collection.

Testing the Component Interface(CI Tester)

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

66

Page 67: Peoplecode Question Ans

PeopleSoft HRMS

Interactive Mode

When in Interactive Mode, any action request occurs immediately. Each property being set causes an immediate trip to the application server (or database server in two-tier mode). This differs from non-interactive mode, in which actions are often held and later sent in batches. For example, in non-interactive mode, if you set a property, the property is not validated until you perform the save. However, in interactive mode the property is validated immediately. This means that edit processing (and other processing, such as FieldChange PeopleCode) occurs for each set property.

Specify whether to get or edit history items.

Selecting Get History Items retrieves history data. Selecting Edit History Items enables editing and saving of history data. These options apply to effective-dated fields only and are equivalent to running in either Update/Display or Correction mode online. These options are initially cleared.

General Considerations

WinMessage Unavailable

You can’t use WinMessage in a component that will be used to build a component interface. Use MsgGet() instead.

Email From a Component Interface

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

67

Page 68: Peoplecode Question Ans

PeopleSoft HRMS

To use a component interface to send email, use TriggerBusinessEvent PeopleCode event, not `SendMail.

Understanding PeopleCode Behavior and LimitationsNote the behavior and limitations discussed in this section when you write PeopleCode for a component interface.

PeopleCode Event and Function Behavior

PeopleCode events and functions that relate exclusively to GUI and online processing cannot be used by component interfaces. These include:

Search dialog processing.

When you run a component interface, the SearchInit, SearchSave, and RowSelect events don’t fire. This means that any PeopleCode associated with these events will not run. The first event to run is RowInit.

DoSave() and DoSaveNow().

The DoSave() and DoSaveNow() pcode functions are not supported. You should use the component interface Save() method and wrap the DoSave() and DoSaveNow() functions so they don’t execute when called from a component interface.

Functions that are ignored in a component interface call.

Some PeopleCode functions are ignored if they are called through a component interface. These functions are:

WinMessage CheckMenuItem

DisableMenuItem

EnableMenuItem

HideMenuItem

UncheckMenuItem

SetCursorPos

TransferPanel

TransferPage

DoModalComponent

IsModalComponent

DoModalPanelGroup

IsModalPanelGroup

GetSelectedTreeNode

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

68

Page 69: Peoplecode Question Ans

PeopleSoft HRMS

GetTreeNodeParent

RefreshTree

TreeDetailInNode

GetControl

DoSave

DoSaveNow

Note. When you use the Create method, you must assign a value to at least one non-Create Key property to ensure that the Save method properly validates the row data. If you don’t assign a value to at least one property, the Save method could erroneously save an invalid record without generating any warnings. Also, declare variables—the session object and the component interface objects are of the type ApiObject.

SQRTypically, every page of a report has some information about the report itself, such as the title, the date, and the page number. In SQR, the page can be subdivided into three logical areas:

The top area of the page is the heading, which is where the report title and the date normally print. The bottom area of the page is the footing, which is where the page number normally prints.

The middle part of the page is called the body, which is where the report data prints.

When you select columns from the database in a SELECT paragraph, you can immediately print them using a position. For example:

begin-selectphone (,1) position (+1)from customersend-select

begin-program do list_customersend-programbegin-procedure list_customersbegin-selectphone if &phone = '' print 'No phone' (,1)

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

69

Page 70: Peoplecode Question Ans

PeopleSoft HRMS

else print &phone (,1) end-if position (+1)from customersend-selectend-procedure ! list_customers

The phone column is an SQR column variable. Column variables are preceded with an ampersand (&).

Unlike other program variables, column variables are read-only. You can use their existing value, but you cannot assign a new value to a column variable.

Using ON-BREAKIn the following program, the ON-BREAK option of the PRINT command accomplishes two related tasks—it starts a new group each time the value of state changes, and prints state only when its value changes. Note that ON-BREAK works as well for implicit as for explicit PRINT commands, such as in the following example, where state, city, name, and phone are implicitly printed as part of the SELECT paragraph.

Handling Page Breaks

If a page break occurs within a group, you may want to reprint headings and the value of the break column at the top of the new page.

To control the printing of the value, use PRINT=CHANGE/TOP-PAGE. With this qualifier, the value of the ON-BREAK column is printed when it changes and after every page break. In this example, the value of state is printed not only when it changes, but whenever the report starts a new page.

To format records, use the NEXT-LISTING command. This command serves two purposes. The SKIPLINES=1 argument skips one line between records, then renumbers the current line as line 1. The NEED=4 argument prevents a listing from being split over two pages by specifying the minimum number of lines needed to write a new listing on the current page. In this case, if fewer than four lines are left on a page, SQR starts a new page.

The following steps explain the order of processing in detail.

1. Process BEFORE Procedures.

BEFORE procedures are processed in ascending order by LEVEL before the first row of the query is retrieved. If no data is selected, BEFORE procedures are not executed.

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

70

Page 71: Peoplecode Question Ans

PeopleSoft HRMS

Setting Break Procedures With BEFORE and AFTERWhen you print variables with ON-BREAK, you can automatically call procedures before and after each break in a column. The BEFORE and AFTER qualifiers provide this capability. For example:

begin-selectstate (,1) on-break before=state_heading after=state_tot

The BEFORE qualifier automatically calls the state_heading procedure to print headings before each group of records of the same state. Similarly, the AFTER qualifier automatically calls the state_tot procedure to print totals after each group of records.

All BEFORE procedures are automatically invoked before each break, including the first—in other words, before the SELECT is even processed. Similarly, all AFTER procedures are invoked after each break, including the last group—in other words, upon completion of the SELECT.

BEFORE procedures are processed in ascending order from the current level to the highest level.

AFTER procedures are processed in descending order from the highest level to the level of the current ON-BREAK column.

Restrictions and Limitations of ON-BREAKON-BREAK cannot be used with SQR numeric variables. To perform break processing on a numeric variable, you must first move its value to a string variable and set ON-BREAK on that. For example:

begin-selectamount_received &amount move &amount to $amount $$9,999.99 print $amount (+1,1) on-breakfrom cash_receiptsorder by amount_receivedend-select

The maximum number of ON-BREAK levels is determined by the ON-BREAK setting in the [Processing-Limits] section of the PSSQR.INI file. The default is 30, but you may increase this setting. Its maximum value is 64K-1 (65,535).

Master/Detail Reports

Master/detail reports show hierarchical information. The information is normally retrieved from multiple tables that have a one-to-many relationship, such as customers and orders. The customer information is the “master” and the orders are the “detail.”

© Patni Computer Systems Ltd. – EAI, PeopleSoft. 2002. Page of 71

Patni Internal

71