Showing posts with label PeopleTools. Show all posts
Showing posts with label PeopleTools. Show all posts

Tuesday, 8 May 2012

PeopleCode to Create XML and XSD file


The below code is useful to create XML and XSD file.  Create Application engine program with below code and run the AE program in App designer to get a file in local. You can get the same in server without specifying any path and give it as relative path instead of file absolute.
PSXP_XMLGEN application package used to create xml file. You can multiple parent and child records. This file is used for data import or export programs.
Import PSXP_XMLGEN:*;
/*Create Rowsets*/
&RS_ADR = CreateRowset(Record.EMPLOYEES);
&RS_PER = CreateRowset(Record.PERSON, &RS_ADR);
/*Fill Parent*/
&RS_PER.fILL(“WHERE EMPLID = ‘11902′”);
/*Fill Child*/
For &i = 1 To &RS_PER.Activerowcount
&row = &RS_PER.Getrow(&i);
&rs = &row.Getrowset(Scroll.EMPLOYEES);
&rs.fill(“Where emplid = :1″, &row.PERSON.emplid.value);
End-For;
/* Create XSD */
&rds = create PSXP_XMLGEN:RowSetDS();
&myschema = &rds.Getxsdschema(&RS_PER);
&f1 = GetFile(“C:\temp\rpt01.xsd”, “w”, %FilePath_Absolute);
&f1.writeline(&myschema);
&f1.close();
/*Create Sample XML File */
&myXMLfile = &rds.GetXMLData(&RS_PER, “C:\temp\rpt01.xsd”);
&f2 = GetFile(“C:\temp\rpt01.xml”, “w”, %FilePath_Absolute);
&f2.writeline(&myXMLfile);
&f2.close();

Friday, 6 April 2012

PeopleCode Interview Questions



1. Where PeopleCode get stored?
 In Database Server (PSPCMPROG table)
2. Suppose if there is same component X in two different menus, menu1 and menu2 and if you want to assign a different search record for each menu, then which PeopleCode function do you use and where do u write the code?
Instead of using PeopleCode, Directly we can assign the search record at the menu level which will override the search Record specified at the component level.
 3. What is Component Processor?
 The Component Processor is the PeopleTools runtime engine that controls processing of an application from the time that a user requests a component from an application menu until the database is updated and processing of the component is complete.
4. Explain How to send email to the all employee from the PeopleSoft application when a certain event is true? What is the event used to trigger?
Create a workflow. In the workflow, use a query with active employees and their email ids as inputs. On the successful occurrence of the event, trigger this workflow using TriggerBusinessEvent.
5. Explain the advantage and disadvantage of SQLExec in PeopleCode?
By using SQLExec function we can do the manipulation to the database. We can write insert, update and delete SQL commands. But drawback while selecting the data using SQLExec, it will return only one at a time another drawback, if the name of the records changed, then you have to make the changes in the code as the query will in the quotes inside SQLExec. 
6. Tell me where can we write the PeopleCode?
1.       Record field level
2.       Page people code
3.       Component level people code
4.       Component record people code
5.       Component record field people code
6.       menu item people code
7.       Application engine people code
8.       Component interface people code
9.       Messaging people code
10.   Application package people code 
7. Tell me is there any function exist in PeopleCode which stops the processing of whole component?
It is "Error" Function. Use the Error function in FieldEdit or SaveEdit PeopleCode to stop whole processing and display an error message. It is distinct from Warning, which displays a warning message, but does not stop processing. Error is also used in RowDelete and RowSelect PeopleCode events. 
8. Tell me what is the difference between SQL Object and SQLExec?
SQL Object is a people tool definition which can be created using app designer as well as using PeopleCode command CREATESQL( ). It is mainly used for reusability of the SQL statements. So whenever this statement is required no need to hard code, just create an SQL object of the same and use where ever it is required.
SQLExec is a PeopleSoft delivered function used to retrieve only one row and u can update multiple rows of data. It directly interacts with the database.
9. Tell me what is the diff between component level PeopleCode and record level PeopleCode?
Record level PeopleCode :
The PeopleCode written on the Record level PeopleCode will effect all the Components in which that particular record is used.
Component Level PeopleCode :
The component level PeopleCode works only for that particular component and if any record in the component is referenced by component level PeopleCode then it would not effect any other component where same record is used.
Sequence: first Record level PeopleCode will fire and then Component level PeopleCode.
10. Can you explain about component Buffer?
                When you open any page in a component, the system retrieves all of the data records for the entire component and stores them in one set of record buffers, organized by scroll level and then by page level. PeopleCode frequently must refer to data in the Component Buffer, that is, the area in memory that stores data for the currently active component.
There are two methods of specifying a piece of data in the Component Buffer from within PeopleCode
-------- Contextual references, which refer to data relative to the location of the currently executing PeopleCode program.
-------- References using scroll path syntax, which provide a complete, or absolute, path through the Component Buffer to the referenced component.
The component buffer contains current active component data it is temporary memory area. 
12. What is the sequence of events fired when a page is saved.
SaveEdit--->SavePreChange--->Workflow--->SavePostChange
13. How to store output of SQL query in a variable using PeopleCode?
Using SQLExec() function
                SQLExec(“select EMPLID, NAME from PS_PERSONAL_DATA”, &emplid, &name);
14. What is an array in people code?
An Array is a collection of data storage locations, each of which holds the same type of data.
The maximum depth of a PeopleCode array is 15 dimensions. Push and UnShift are the functions of the array used to add the elements into the array one from the end of the array and one from the    beginning. Pop is a function of array used to select and delete an element from the end of the array.
15. PeopleCode attached with Push Button can be associated with which events?
                Field Edit, Field Change
16. Which PeopleCode debugging tool automatically converts values of any data type?
                WinMessage
17. What is Differed processing and its advantage?
                Postpones some user actions to reduce the number of trips to the database.
                Advantages:       1) Reduces network traffic
                                                2) Increase performance
18. What is Rowset?
Rowset is data structure representing the hierarchical data. Rowset consists of set of rows, where each row consists of set of records and child Rowsets. We can retrieve data from data buffer and component buffer using Rowset.
19. Difference between SavePreChange and SavePostChange?
SavePreChange is fired when the component buffer is not cleared. It provides one final opportunity to manipulate data before the component processor updates the DB where as SavePostChange is fired when the buffer is cleared (i.e., component processor updates the DB) and before the commit is issued by the database.
20. How to change prompt table dynamically?
Using PeopleCode function “%EditTable”
21. What are Think time functions?
Think-time functions suspend the processing of the whole of component either until the user has taken some action (such as clicking a button in message box) or until an external process has run to completion.
Ex:  DoCancel, DoModal, DoComponent, WinMessage, WinMessageBox etc..
22. What is the difference between RowInit and RowInsert?
RowInit event fires the first time the Component process encounters a row of data.
RowInsert event fires when the end-user adds a row of data. Don’t put PeopleCode in RowInsert that is already exists in RowInit, because a RowInit always fires before the RowInsert event, which will cause your code to be run twice.

Application Designer Interview Questions

1. What are Popup Menu types available?
                1.Transfer
                2.PeopleCode
                3.Separator
2. What views are available in Application Designer project workspace?
                Development and Upgrade
3. If you change the long name of translate field what object to be altered?
                Page definition
4 .Can you place Sub page into Grid? If yes How?
                yes, we can insert subpage using insert subpage. After insert subpage into main page, drag the subpage into the grid. When we save the page we are successfully able to save the page showing that we can insert a subpage into a grid.
5.Limitations of translate table?
ü  Field type should be character
ü  Minimum filed length should be 1 to 4 characters
ü  Field value should be small and static 
6. What is SET CONTROL TABLE?
Set control table default value is Business unit. It contains record groups and its default value is SetID. So it is used to access data from different Business unit.
7. Define auditing in PS? Types of auditing and explain each?
There is two types of audits available PS. Record level audit and record field level Audit.
8. Which PS object can’t be blocked by developers as a part of change control locking system?
Process Definition
9. Define Scroll? How many types of scrolls are there?
A Scroll is used to enter multiple rows and retrieve multiple row data. 
1. Nested scrolls – For each repeating data and for each entry with other set of repeating set of data is called a nested scroll. Maximum 3 nested levels are allowed. The nested scrolls share same high level keys.
2. Independent Scrolls: At each scroll level a maximum of 15 screens can be included.
10. What is mutually exclusive build execute option with the alter build option?
                Execute SQL now
11. How to view report from application designer?
                fileàreport from fileàview report
12. What is registering a component?
                We will add the component to menu and give permissions and security.
13. How to run AE program from Application Designer?
                open AEàeditàRun Program
14. Difference between search record and add search record?
                No diff b/n both the records, but add search record should be used in add mode.
15. Define component buffer and data buffer?
Component buffer consists of active component data, but data buffer contains multiple component data and other PeopleSoft applications data also.
16. What is the use of owner id in any PS object general properties?
                It is useful to restrict the PS object to the certain module.
17. What is the use of default page control in record field properties?
Specify the default appearance of a field as it appears on the page that Corresponds with the record field that you are creating.
18. How to set 3tier execution location of a component?
Component properties--àuse-à3tier execution location
19. When registering a component to menu, menu bar name is not mandatory (true/false)?
                False 
20. What is default grid occur level?
                one
21. How do you bring advanced search page before normal search page?
                Component propertiesàinternetàdefault search/look up typeàbasic or advanced.
22. What are the numbers of sub pages and secondary pages that can be created in one level?
multiple number of subpages can be created in one scroll level but only one secondary page can created in one scroll level using push/hyperlink.
23. How to combine two projects?
                fileàmerge projectsàInsert project nameàinsert
24. Define update ids in project properties?
                These are useful, when change project option is activated.
25. The default processing mode of the component?
                Deferred Mode
26. Define Record?
                A record definition is definition of what your underlying SQL database tables will look like, and how they will process data.
27. Record types that are not going to store in to Database/types that can't be build?
                Derived/work record, dynamic view and Sub record.
28. “Approval rule set” is not PeopleSoft object? (true/false)
                False
29. How to disable the appearance of prompt button on a page?
                Page field propertiesàrecordàdisplay optionsàshow prompt button (UN check)
30.  What happened when select “build script file” option?
                Table is not going to create into database but it’s just creating Script file.