TransferPage function

Syntax

TransferPage([Page.page_name_name])

Description

Use the TransferPage function to transfer control to the page indicated by Page. page__name 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 the component processor prior to transfer into, use the Transfer function.

Note:

If the visibility of the current page is set to False in a PeopleCode program, then you must invoke the TransferPage function to transfer control to a visible page.

See SetNextPage function, Transfer function.

Note:

You can’t use TransferPage from a secondary page.

Any variable declared as a Component variable will still be defined after using a TransferPage function.

Parameters

Parameter Description

page_name

A String equal to the name of the page you are transferring to, as set in the page definition, prefixed with the reserved word Page. The page must be in the same component as the page you are transferring from.

Returns

Optionally returns a Boolean value indicating whether the function executed successfully.

Example

The following examples both perform the same function, which is to transfer to the JOB_DATA_4 page:

TransferPage(Page.JOB_DATA_4);

or

SetNextPage(Page.JOB_DATA_4);
TransferPage( );

Considerations Using TransferPage

The following are important considerations when using the TransferPage function:

  • TransferPage always terminates the current PeopleCode program.

  • TransferPage is always processed after all events are completed.

Given these considerations, here are some scenarios for how TransferPage executes:

  • When called in RowInit: The current RowInit PeopleCode program is terminated, but RowInit processing continues. In addition, RowInit PeopleCode programs run for the rest of the fields in the row. Then TransferPage is processed.

  • When called in FieldEdit: The FieldEdit PeopleCode program is terminated. The FieldChange program for that field still runs. Then TransferPage is processed.

  • When called in SavePreChange: The SavePreChange program for that field is terminated. SavePreChange runs for the rest of the fields on that page. Then SavePostChange run for all the fields. Then TransferPage is processed.

  • When called in FieldChange in deferred mode: In deferred mode, changed fields are processed in order. The FieldChange program is terminated. Then any subsequent fields in the page order are processed with the normal FieldEdit-Field Change logic. Once that has finished, the TransferPage is processed.

When TransferPage is processed, any PeopleCode associated with the Activate event for the page being transferred to runs. This always occurs at the end, after all field processing.

If TransferPage is called multiple times during field processing, all the calls are processed at the end, in the same order the calls were made. The Activate event executes each time. The final active page is the one that was transferred to by the last call.

Restrictions on Use With a Component Interface

This function is ignored (has no effect) when used by a PeopleCode program that’s been called by a Component Interface.

Restrictions on Use With SearchInit Event

You can't use this function in a SearchInit PeopleCode program.