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 you’re 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 you’re transferring to a separate instance of a component. You cannot use Transfer from a secondary page if you’re 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 you’re 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 you’re transferring to a separate instance of a component. You cannot use TransferExact from a secondary page if you’re 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");