You are on page 1of 26

Sleep Function Within PeopleCode PeopleSoft

While at work today I discovered that there doesnt appear to be any built in functionality to allow
for a delay to be implemented within PeopleCode. Thankfully there are a couple of roundabout
way you can go about doing this:
#1: Works if you are sitting on an Oracle DB
/* The following code creates a 5 second delay using DBMS_LOCK.SLEEP */
&s = 5;
SQLExec("exec DBMS_LOCK.SLEEP(:1)", &s);

#2: Note that this method is not as efficient as DMBS_LOCK.SLEEP()


/* The following code creates a 5 second delay using the java sleep method */
&s = 5;
GetJavaClass("java.lang.Thread").sleep(1000 * &s);

Access Log PeopleSoft


Leave a reply

I came across a requirement today where I needed to find out when a user had last logged into
PeopleSoft. The record PSACCESSLOG came in handy here, it stores all of the following:
PSACCESSLOG
OPRID: The users operator ID
LOGIPADDRESS: The users IP address
LOGINDTTM: A timestamp showing when the user logged in
LOGOUTDTTM: A timestamp showing when the user logged out
PT_SIGNON_TYPE: The signon type
Find Last Login Date for User:
SELECT *
FROM PSACCESSLOG
WHERE oprid = '<OPERATOR ID>'
ORDER BY effdt DESC;

Find all logins since 1st March 2012:


SELECT *
FROM PSACCESSLOG
WHERE TO_DATE(CAST(logindttm AS DATE), 'dd/mm/yy') >= TO_DATE('01/03/2012',
'dd/mm/yy');

PSACCESSLOG - Login History in PeopleSoft

http://psjose.blogspot.in/2013/01/jquerymobil
e-calendar-on-peoplesoft-pia.html
http://ps.mytechspeak.com/2012/07/s
o-need-is-calendar-view.html
http://danielkibler.blogspot.in/2010/10
/using-jquery-in-peoplesoftintroduction.html
How to Create Calendar using jQuery
and CSS3
Valeriu Timbuc CSS3, jQuery, Tutorials April 4, 2012 11 Comments

Topic: jQuery & CSS3


Difficulty: Intermediate
Estimated Completion Time: 30 mins
In this tutorial we will code the jQuery and CSS3 Calendar that you can find inFuturico
UI Pro made by Vladimir Kudinov. To do it we will use CSS for all the styling and
for functionality we will use jQuery and jQuery UI. From jQuery UI we will only use
the Datepicker script. So you dont have to download all the components available in
jQuery UI and the file size will be lower.

Step 1 HTML Markup


To create the calendar we only need to add a div tag with an id.
SEE ALSO: Startup Framework on Rails
1

<div id="calendar"></div>

Then before the body closing tag we need to add the jQuery and the jQuery UI script.
We also need to call the datepicker, so you need to use the same id that youve used
on the div. We will also add some options: the inline will make the calendar visible, so we
dont need to click on a button or input; to make Monday the first day on the calendar

we need to set it to 1; show other months will add the others months days in order to fill
all the table. For more info about all the options available read thedocumentation.
1
2
3
4

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></s
<script src="js/jquery-ui-datepicker.min.js"></script>
<script>
$('#calendar').datepicker({

inline: true,

firstDay: 1,

showOtherMonths: true,

dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']

9
10

});
</script>

Step 2 Container
Lets start by removing all the margins, paddings, borders, etc.
1

.ui-datepicker,

.ui-datepicker table,

.ui-datepicker tr,

.ui-datepicker td,

.ui-datepicker th {

margin: 0;

padding: 0;

border: none;

border-spacing: 0;

10

Then we will style the calendar container. Lets add a background color, rounded corners
and shadows. We will also change the text font to Tahoma and the text size.
1

.ui-datepicker {

display: none;

width: 294px;

padding: 35px;

cursor: default;

6
7

text-transform: uppercase;

font-family: Tahoma;

font-size: 12px;

10
background: #141517;

11
12
13

-webkit-border-radius: 3px;

14

-moz-border-radius: 3px;
border-radius: 3px;

15
16

-webkit-box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,

17

-moz-box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,0);

18

box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,0);

19
20

Step 3 Header
To style the header of the calendar (month and year) we will change the text colors, add
a border bottom and some more basic styles.
1

.ui-datepicker-header {

position: relative;

padding-bottom: 10px;

border-bottom: 1px solid #d6d6d6;

6
7

.ui-datepicker-title { text-align: center; }

8
9

.ui-datepicker-month {
position: relative;

10

padding-right: 15px;

11
12

color: #565656;
}

13
14

.ui-datepicker-year {

15

padding-left: 8px;

16

color: #a8a8a8;

17

18

To add the green circle we will use the :before pseudo selector. This will allow us to
insert content before the month element and then we will style and position it.
1
2

.ui-datepicker-month:before {
display: block;

position: absolute;

top: 5px;

right: 0;

width: 5px;

height: 5px;

content: '';

9
10

background: #a5cd4e;

11

background: -moz-linear-gradient(top, #a5cd4e 0%, #6b8f1a 100%);

12

background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a5cd

13

background: -webkit-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);

14

background: -o-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);


background: -ms-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);

15

background: linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);

16
17

-webkit-border-radius: 5px;

18

-moz-border-radius: 5px;

19

border-radius: 5px;

20
21

Step 4 Prev & Next Month


We will use a background image to style the next and previous arrows and then we will
position the previous on the left and the next on the right.
1

.ui-datepicker-prev,

.ui-datepicker-next {

position: absolute;

top: -2px;
padding: 5px;

cursor: pointer;

6
7

8
.ui-datepicker-prev {

left: 0;

10
11

padding-left: 0;
}

12
13

.ui-datepicker-next {

14

right: 0;

15

padding-right: 0;

16
17

18
19

.ui-datepicker-prev span,

20

.ui-datepicker-next span{
display: block;

21

width: 5px;

22

height: 10px;

23

text-indent: -9999px;

24
25
26

background-image: url(../img/arrows.png);
}

27
28

.ui-datepicker-prev span { background-position: 0px 0px; }

29
30

.ui-datepicker-next span { background-position: -5px 0px; }

31
32

.ui-datepicker-prev-hover span { background-position: 0px -10px; }

33
34
35

.ui-datepicker-next-hover span { background-position: -5px -10px; }

Step 5 Calendar Styles


To style the days of the week we will add a top and bottom padding and change the
color.
1

.ui-datepicker-calendar th {

padding-top: 15px;

padding-bottom: 10px;

4
5

text-align: center;

font-weight: normal;

color: #a8a8a8;

Then we will style the days grid by adding some paddings, changing the colors and we
will add a transparent border to each number. This is needed because we will add a
border to the active number so to avoid it to jump when we click on a number we need to
add this transparent border.
1

.ui-datepicker-calendar td {
padding: 0 7px;

2
3
4

text-align: center;

line-height: 26px;

7
8
9
10
11
12

.ui-datepicker-calendar .ui-state-default {
display: block;
width: 26px;
outline: none;

13

text-decoration: none;

14

color: #a8a8a8;

15
border: 1px solid transparent;

16
}

17

For the active state we will change the text and border color to green. For the other
months days we will change the color to a darker one.
1

.ui-datepicker-calendar .ui-state-active {

color: #6a9113;

border: 1px solid #6a9113;

5
6

.ui-datepicker-other-month .ui-state-default { color: #565656; }

Conclusion
We finished our calendar. If you have any question let me know in the comments. Also
dont forget to leave some feedback and share it with your friends. Follow us if you want
to be the first to know about the latest tutorials and articles.

Understanding Expert Entry

Expert entry enables a user to change from interactive to deferred mode at runtime for
appropriate transactions.
Note. Expert entry should be used only by expert users of the transaction who understand
how all of the fields in the transaction behave. It requires the user to know the exact

keystroke sequence for the transaction. This sequence typically varies for a transaction by
customer, depending on the customer's setup and entry requirements. Therefore, expert entry
should not be used by occasional users, because they might not be aware of the nuances of
the transaction and when it is necessary to press the Refresh hot key.
To use expert entry, select:

The Allow Expert Entry check box on the Internet tab of the Component Properties
dialog box.

The Enable Expert Entry check box in the user's profile.

If these check boxes are selected, an Expert Entry check box appears on the bottom of the
page at runtime. If the user selects this check box, the transaction runs in deferred mode,
regardless of the setting on the component, page, or field property.
When you set the component property to deferred mode, that component operates in deferred
mode processing for all users, not just those who have expert entry enabled in their profiles.
If you want the component to process in deferred mode for some users and interactive mode
for other users:

Set the component property to Interactive mode.

Select the Allow Expert Entry check box.

This enables security user profiles to control the users for whom deferred mode processing is
possible.
Warning! Users who modify component properties from interactive mode to deferred mode
or select the Allow Expert Entry check box should understand that this is an adaptation of the
software, and, as such, they are responsible for thoroughly testing and supporting this change.
Refresh Button
The Expert Entry feature enables you to specify whether a Refresh button should be included
on the component toolbar when the page is displayed. The Refresh button forces a
transmission to the server to determine which fields have changed since the last transmission
to the server and to run any processing logic that is associated with those changes.
Users can also refresh by pressing the Alt+0 hot key, which keeps the cursor in the same field
when the page is refreshed. One can refresh any time during data entry to enable an expert
user to:

Update related display field values for the data that is already entered.

Recalculate totals and balances.

Provide defaults based on prior data that was entered on the page.

Validate the data that has been entered on the page so far.

Invoke the code to hide or gray items associated with specific fields.

Limitations of Expert Entry


These limitations exist when expert entry is enabled:
Hide,
Unhide,
Gray, and
Ungray

The user must click the Refresh button after entering a value in a field that is
associated with PeopleCode associated that hides, unhides, grays, or ungrays
other fields on the same page.

Drop-down The user must click the Refresh button after entering a value in a field that is a
list box
high-order key that is used to control the values in a drop-down list box.

Default
values

Whenever expert entry is properly enabled and selected by the user at runtime,
the transaction runs in deferred mode. As such, defaults, totals, balances, and
related displays are not updated until the next transmission to the application
server (for example, when the user clicks a button, icon, link, or another tab).
If the user wants the page updated before then, the user must click the Refresh
button.

Enabling Expert Entry through Security

To have the Expert Entry check box appear in the component at runtime, the security
administrator must enable it in Security. This enables the Expert Entry check box to appear in
any components for which you select the Allow Expert Entry property on the Internet tab of
the Component Properties dialog box.
To enable expert entry through Security:
1. Sign in to the PeopleSoft system in your browser.
2. Select PeopleTools, Security, Use, User Profiles.
3. Select the General tab.
4. Select Enable Expert Entry in the General Attributes group box.
5. Click Save.

What are properties?


The Fields in the level 0 in the component are the properties of the component.

Standard properties
Createkeyinfocollection
Getkeyinfocollection field properties.

User-Defined properties
Developer can further control the exposed

Findkeyinfocollection
Property Info collection
GetHistoryItems (Update/Display mode or
Correction mode)
EditHistory Items
InteractiveMode

What is method? What are the different types of method?


Methods: - A method is an object that performs a very specific function on a component interface at
run-time.
Standard methods and user-defined methods.
Standard methods: - Automatically generated upon the creation of a new component Interface in
Application.
Apart from the Standard methods there are Standard methods available for the use with any
collection.
User-Defined methods: - User-defined methods are those that you can create to meet the
requirements of an individual component interface.

How do you provide security for the component interface?


Open the Permission list
On the Component Interface tab, Add row and select the newly created Component Interface.
Edit the permissions to give permission for the standard methods
Get, Create, Save, cancel, find.

What is the difference between exit(0),exit(1) when we are using this functions in
AE

Exit (1) causes immediate termination of a PeopleCode program. Use this parameter to rollback
database changes. Go to the next Step or if that is the last step then return back to the calling Section.
Exit (0) caused immediate termination of a Peoplecode Program but dont make rollback in the
database. Go to the next action.

What are different types Do Select?


1)

Select/Fetch

2)

Reselect

3)

Restart able

Select/Fetch: Opens the cursor only at the first time and retrieve rows one at loop.
Commits inside the step (commits in the Called Section) are ignored if AE is Restart enabled.
Reselect: It opens the cursor and closes the cursor on each iteration of the loop.
It will reselect the same row of data.
Logic in Actions of the step should be such that it will be changing the status of the rows in the table
the do select is selecting.
Commits are not ignored and will be committed in a reselect loop when the restart is enabled.
Restart able: - similar to select/Fetch but it WILL COMMIT inside the loop thus allowing the
checkpoint to the PS_AERUNCONTROL table.

Advantages of Set Processing?


Improved Performance: - Our internal testing has revealed that, in an overwhelming majority of cases,
set processing performs significantly better than it is -by-row counterpart for reasonable batch
processing volumes.
Minimized SQL Overhead: - It tends to use fewer Application Engine SQL statements that each
processed more data than the statements executed in row-by-row processing.
Easy Maintenance: - if need to make a fix or add an enhancement to SQL, its just a matter of
modifying the SQL or inserting the new Chunk.
Leveraging the RDBMS: - With Set based processing, you take advantage of the SQL processing
engine on the database rather than placing the processing burden and overhead on the application
executable.

What is Set Processing?


Set Processing uses SQL to process groups, or sets, of rows at one time rather than processing each
row individually. With row by row processing you following a repetitive loop that selects a row,

determines if it meets a given criteria, if so, apply rule x to row Update row, commit. With set
processing, you only select those rows that meet the filtering criteria and then run the rule once again
all the affected rows.

For details between set based and parallel processing, visit here.

How do you program AE program for the restarts?


Program Level
State Record
One of the state record needs to SQL Table, Since All Derived work record will be re-initializing on
commit.
Program Properties
On the Advanced tab in the program properties dialog box, make sure that disable restart is not
checked.
Configuration manager
In the configuration manager, sure that Disable restart is not selected on the process scheduler tab.
Section Level
Section type
The option for section type are prepare only and critical updates
n
If the section is preparing data i,e select data, Populating temporary tables, or updating
temporary tables then the section should be prepare only.
n
If the section is updating the permanent application tables in the database, you should select
critical update.
Step Level
Add an order by clause
%Select Field Select Field1 from PS_SOME_RECORD Where FIELD1 > %Bind (FIELD1) Order by
FIELD1.
Add a switch to the selected table
Delete processed rows.
The only restriction for batch runs occurs when you have restart enabled, and you are inside a Do
Select 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.

What are the Different types of Application Engine?


Standard: Standard entry-point program.

Upgrade Only: Used by PeopleSoft Upgrade utilities only.


Import Only: Used by PeopleSoft Import utilities only.
Daemon Only: Use for daemon type programs.
Transform Only: Support for XSLT Transform programs.

What are the 3 common ways to pass a trace parameter and value to your
program psae.exe?
Configuration manager,
Process Definition,
Command prompt.

What is the difference between a Trace value and Trace parameters?


A Trace parameter determines which type of trace is turned on.
A Trace parameter determines what type of data is recorded in your trace files (s).

Which Trace option is the best place to start for general performance
information?
-

TRACE <trace value> 384 mostly used trace value.

What are the 3 trace parameters you can pass to your psae.exe?
-

TRACE <trace value>

TOOLSTRACESQL <trace value>

TOOLSTRACEPC <trace value>

Providing Security to PS Queries

PS Query is user friendly (at least for developers ) to pull out and see data
residing in database tables. Usually business users are given access to PS Query
components to create and view new/existing queries. These data they will be
able to be downloaded to their system in different formats. This posses a critical
risk on your sensitive data. Displaying or exposing data to a wrong set of users is
a real threat and if sometimes auditors will catch it, it can affect your company
certification as well other than the data exposure threat.

PeopleSoft has provided 3 different levels of control to restrict your data to only
the right set of users. I will try to provide a brief idea on the various security
levels available for PS Queries.

1.

Component Security

You will get delivered Query Manager, Query Viewer and Schedule Query
components with your application package. Not all of your business users may
need to access data other than from the transaction components. Usually very
few core business users would need transaction datas that need to be exported
and processed further. So restrict the access to these components via permission
list and assign the permission list to only the right set of users. This should be
your first level of security to prevent the data explosion risk.

2.

Query Security Trees:


You may have different set of users acting on the system. For example if you
consider the financial domain, you will have accountants who deals with the
accounting entry and you may have a separate procurement team who will be
concerned only with procuring goods for the company. Both the team might have
requirement to access PS Queries. So you will be providing access to the PS
Query components. But if you look further, the procurement team should not be
given the opportunity to view accountants data at general ledger and vice
versa. To tackle this situation, PeopleSoft has provided another layer called
Query Security Trees. Basically at this level you will be restricting the access to
each back end tables (records) to the concerned groups only. If you do not add a
record to a query security tree which is assigned to a user via permission lists,
that user will not be able to view or create a new query containing that particular
record.
Steps to be followed to provide this level of access is as follows.

a.

b.
c.

d.
e.

Go To: PeopleTools > Security > Query Security > Query Access Manager. Open
a query tree corresponding to your module. If it doesnt exists, go ahead and
create one.
Add your record as a node to the tree and save.
Now you should associate the Query Tree with a permission list. For that open
the permission list (People Tools > Security > Permission & Roles > Permission
List) and go to the Query Tab.
Click on the Access Group Permissions and provide your Tree and Branch names
and save it.
Assign the permission list to a role and the role to a user.

With the above steps you have successfully provided the second level security
for the data, i.e individual record level security.

3.

Query Security Record

Implementing the above will put in place most of the security to the data that
you require. But there are some cases where you want to add more security. As
per the setting above, the user has full data access to the records assigned to
the query security tree. But what about the data inside the record? Consider the
case of HRMS where you have sensitive data. For example take the
PERSONAL_DATA record. The user getting access to other peoples personal
details is not acceptable. To overcome this situation PeopleSoft has delivered the
third layer of security via Query Security Records also called as row level
security. Query security records are views which will select the data from the
base table and also adds additional where clause to restrict the data fetched.
You can follow the below steps to implement row level security for PS Query
output.
a.
b.
c.

Create a view which fetches the desired data from the base table
Add all the keys of underlying record to the view
Add one more additional key from OPRID, OPRCLASS & ROWSECCLASS.
PeopleSoft will automatically create the where clause for this extra field.
d. Now add the record created to the Query Security Record field of the underlying
records property in the Use tab. PeopleSoft will automatically join this record with
the underlying record when the Query is executed. You can verify the same by
looking at the SQL statement of the PS Query.
Once you have done with these three steps, you are done with all the three layers of
security. Want more? Do you want to hide the data based on values of multiple
columns? As per my best knowledge there are no other options now. You can
leave the comments, if you know some methods. Otherwise lets wait until
People Tools brings up row level security to multiple fields.

How to transfer a page from one component to a page in another component?


Using function Transfer and TransferExact

Differences Between Transfer and TransferExact


When you do a transfer, the first thing the system checks is whether all the key field values for the
target component are provided.
If all the keys aren't provided, the search page is displayed. In this scenerio, TransferExact and
Transfer are the same.
If all the keys are provided, a Select is done against the search record for that component using those
keys.

If you use the Transfer function, a LIKE operator is used in the Where clause of that Select for
each key.

If you use the TransferExact fuction, the equals operator is used in the Where clause for each
key. Using equals allows the database to take full advantage of key indexes for maximum
performance.

Transfer

Syntax
Transfer(new_instance,
MENUNAME.menuname,
BARNAME.barname,
ITEMNAME.menu_itemname,
PAGE.component_item_name,
action [, keylist] [, AutoSearch]);
Use the Transfer function to close the current page and transfers the end-user to another page, either
within the current component or in another component. Transfer can either start a new instance of
the application and transfer to the new page there, or close the old page and transfer to the new one in
the same instance of PeopleTools.
Transfer is more powerful than the simpler TransferPage, which permits a transfer only within the
current component in the current instance of PeopleTools. However, any variables declared as
Component do not remain defined after using the Transfer function, whether youre transferring
within the same component or not.
You can use Transfer from a secondary page (either with or without using a pop-up menu) only if
youre transferring to a separate instance of a component. You cannot use Transfer from a secondary
page if youre not transferring to a separate instance of a component.
new_instance

Set this parameter to True to start a new application instance, or to False to


use the current window and replace the page already displayed.

Menuname

The name of the menu where the page is located prefixed with the reserved
word MENUNAME.

Barname

The name of the menu bar where the page is located, prefixed with the
reserved word BARNAME.

menu_itemname

The name of the menu item where the page is located, prefixed with the
reserved word ITEMNAME.

component_item_name The component item name of the page to be displayed on top of the
component when it displays. The component item name is specified in the
component definition. This parameter must be prefixed with the keyword
PAGE.
Action

Uses a single-character code as in %Action. Valid actions are "A" ( add), "U"
(update), "L" (update/display all), "C" (correction), and "E" (data entry).

Keylist

An optional list of field specifications used to select a unique row at level zero
in the page you are transferring to, by matching keys in the page you are
transferring from. It can also be an already instantiated record object.
If a record object is specified, any field of that record object that is also a
field of the search record for the destination component is added to keylist.
The keys in the fieldlist must uniquely identify a row in the "to" page search
record. If a unique row is not identified, or if Force Search Processing is
selected for the component, the search dialog box appears.
If the keylist parameter is not supplied then the destination component's
search key must be found as part of the source components level 0 record
buffer.

AutoSearch

Specify whether an automatic search on the target search page is executed


after the transfer. This means the search results are already shown without
the end-user having to click the Search button. This parameter takes a
Boolean value: True, do an automatic search. The default value is False (that
is, the user has to click the Search button).

Returns
None.
Example
The example starts a new instance of PeopleTools and transfers to a new page in Update mode. The
data in the new page is selected by matching the EMPLID field from the old page.
Transfer(true, MENUNAME.ADMINISTER_PERSONNEL, BARNAME.USE, ITEMNAME.
PERSONAL_DATA, PAGE.PERSONAL_DATA_1, "U");
TransferExact

Syntax
TransferExact(new_instance,
MENUNAME.menuname,
BARNAME.barname,
ITEMNAME.menu_itemname,
PAGE.component_item_name,
action [, keylist] [, AutoSearch]);
Use the TransferExact function to close the current page and transfers the user to another page, either
within the current component or in another component. TransferExact can either start a new instance
of the application and transfer to the new page there, or close the old page and transfer to the new one
in the same instance of PeopleTools.

TransferExact is more powerful than the simpler TransferPage, which permits a transfer only within
the current component in the current instance of PeopleTools. However, any variables declared as

Component do not remain defined after using the TransferExact function, whether youre transferring
within the same component or not.
You can use TransferExact from a secondary page (either with or without using a pop-up menu) only
if youre transferring to a separate instance of a component. You cannot use TransferExact from a
secondary page if youre not transferring to a separate instance of a component.
Example
The example starts a new instance of PeopleTools and transfers to a new page in Update mode. The
data in the new page is selected by matching the EMPLID field from the old page.
TransferExact(true, MENUNAME.ADMINISTER_PERSONNEL, BARNAME.USE,
ITEMNAME.PERSONAL_DATA, PAGE.PERSONAL_DATA_1, "U");

Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest


Labels: PeopleCode
How to go from secondary page to main page by using peoplecode?
Use "Endmodal(0)" to go back to main page. If it is a system Ok and cancel button, then it
automatically goes back to main page, if it is customized button, we need to use "endmodal(0)" to go
back to main page

Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest


Labels: PeopleCode
Difference between Domodal and transferpage?
The DoModal function displays a secondary page. Secondary pages are modal, meaning that the user
must dismiss the secondary page before continuing work in the page from which the secondary page
was called.If you call DoModal without specifying a level number or any record parameters, the
function uses the current context as the parent.We can alternately specify a secondary page in a
command push button definition without using PeopleCode. This may be preferable for performance
reasons, especially with Web client code. DoModal can display on a single page. To display an entire
component modally, use DoModalComponent. Any variable declared as a Component variable will
still be defined after using a DoModal function.
While a TransferPage transfers control to the page indicated by PAGE. page_name within, or to
the page set with the SetNextPage function. The page that you transfer to must be in the current
component or menu. To transfer to a page outside the current component or menu, or to start a
separate instance of PeopleTools prior to transfer into, use the Transfer function.

Note. You cant use TransferPage from a secondary page. Any variable declared as a Component
variable will still be defined after using a TransferPage function.

Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest


Labels: PeopleCode
What is DoModal?
Syntax
DoModal(PAGE.pagename, title, xpos, ypos,
[level, scrollpath, target_row])
where scrollpath is:
[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]]
RECORD.target_recname
To prevent ambiguous references, you can also use SCROLL.scrollname, where scrollname is the same
as the scroll level?s primary record name.
Description
The DoModal function displays a secondary page. Secondary pages are modal, meaning that the user
must dismiss the secondary page before continuing work in the page from which the secondary page
was called.
If you call DoModal without specifying a level number or any record parameters, the function uses the
current context as the parent.
You can alternately specify a secondary page in a command push button definition without using
PeopleCode. This may be preferable for performance reasons, especially with Web client code.
DoModal can display on a single page. If you want to display an entire component modally, use
DoModalComponent.
Any variable declared as a Component variable will still be defined after using a DoModal function.
Returns
Returns a number that indicates how the secondary page was terminated. A secondary page can be
terminated by the user clicking a built-in OK or Cancel button, or by a call to the EndModal function
in a PeopleCode program. In either case, the return value of DoModal is one of the following:
? 1 if the user clicked OK in the secondary page, or if 1 was passed in the EndModal function call that
terminated the secondary page.
? 0 if the user clicked Cancel in the secondary page, or if 0 was passed in the EndModal function call
that terminated the secondary page.
Parameters
- pagename The name of the secondary page.
- title The text that will be displayed in the caption of the secondary page.
- xpos, ypos The pixel coordinates of the top left corner of the secondary page, offset from the top left
corner of the parent page (the default of -1, -1 means centered).

- level Specifies the level of the scroll level on the parent page that contains the row corresponding to
level 0 on the secondary page.
scrollpath A construction that specifies a scroll level in the component buffer.
- target_row The row number of the row in the parent page corresponding to the level 0 row in the
secondary page.
Restrictions on Use in PeopleCode Events
Control does not return to the line after DoModal until after the user has dismissed the secondary
page. This interruption of processing makes DoModal a "think-time" function, which means that it
shouldn?t be used in any of the following PeopleCode events:
? SavePreChange
? SavePostChange
? Workflow
? RowSelect
? Any PeopleCode event that fires as a result of a ScrollSelect, ScrollSelectNew, RowScrollSelect or
RowScrollSelectNew function call.
Restrictions on Use with a Component Interface
This function can?t be used by a PeopleCode program that?s been called by a Component Interface.
You should put a condition around this function, testing whether there?s an existing Component
Interface or not.
If %CompIntfcName Then
/* process is being called from a Component Interface */
/* do CI specific processing */
Else
/* do regular processing */
...
End-if;
Example
DoModal(PAGE.EDUCATION_DTL, MsgGetText(1000, 167, "Education Details - %1",
EDUCATN.DEGREE), - 1, - 1, 1, RECORD.EDUCATN, CurrentRowNumber());

Use the DoModalComponent function to launch a modal component. The modal component launches
from within an originating component. After the modal component displays, the user cant proceed
with changes to the originating component until either accepting or canceling the modal component.
Essentially, you are requesting a specific page on a component to be opened from an existing
component say on a click of a button. So you need another component defined with a page that you
want opened when the method is invoked.
Subpages becomes part of a page and do not have an identity of its own. Generally, all the fields on a
sub page are part of a sub record.For e.g. an address subpage.
Secondard pages generally are placed on the Page itself and opened up when the user clicks a link
button on a page on when the seondard page is placed. one could use a do modal to open a secondard

page. Generally used when, real estate on a page is insufficient and you want to move some fields
generally not touched by users on s separate secondary page.
I sugguest you try to create pages, components etc and you will get an idea of what is happening. Just
reading peoplebooks will not help.
Part of it is because of how Peoplebooks is organized.
For e.g. all the function are organized alphabetically and just reading a function in isolation will not be
be very helpful. ( unfortunately. )
Maybe start building simple pages and components . For the issue at hand, creat 2 components with
pages attached to each andthe call domodalComponent from one. Try calling a sub page or a
secondard page using the function and you will know why that function cannot be used.

The IsModal function returns True if executed from PeopleCode running in a modal secondary page
and False if executed elsewhere. This function is useful in separating secondary page-specific logic
from general PeopleCode logic.

You might also like