Transfer

Transfer is one of those PeopleCode functions that needs more explanation and some better examples in PeopleBooks :D

Here's a bit more about how to use it:

The official syntax from PeopleBooks is:

Transfer(new_instance, MENUNAME.menuname, BARNAME.barname, ITEMNAME.menu_itemname, PAGE.component_item_name, action [, keylist] [, AutoSearch]);

New Instance can be either true or false (boolean). True means you want to create a new window, false means that it will reuse the existing window.

To figure out the MENUNAME, BARNAME, ITEMNAME, PAGE query the PSAUTHITEM table. You can use the following query provided you know the menu and page names. The more you know, the better. Remember that this returns all permission lists (CLASSID) associated with menu item:

select * 
from PSAUTHITEM
where MENUNAME = 'YOUR_MENU'
and PNLITEMNAME = 'YOUR_PAGE'

The corresponding values in this table are:

  • MENUNAME = MENUNAME
  • BARNAME = BARNAME
  • ITEMNAME = BARITEMNAME
  • PAGE = PNLITEMNAME

You have the following actions available (%Action):

  • A = add
  • U = update
  • L = update/display all
  • C = correction
  • E = data entry

Make sure that the users will have the appropriate action available on the page you are transferring to. This is where the AUTHORIZEDACTIONS field in the PSAUTHITEM table can be handy - this tells you which authorized actions correspond to which permission lists. Check out this article for more information about how this field works.

Here's a simple example of how to transfer to the application entry component in Campus Solutions, reusing the existing window and entering in add mode:

Transfer(False, MenuName."PROCESS_APPLICATIONS", BarName."USE", ItemName."APPLICATION_DATA_ENTRY", Page."SCC_BIO_DEMO_PERS", "A")

Troubleshooting

If the user does not have access to a particular component, transfer will give an error like this:

You are not authorized for this page.

Check that the user has access to at least one of the relevant permission lists for where they are being transferred.

A transfer can also take you to a blank page, even though you have specified a valid menu item. In this case:

  • Double check your transfer code - are you sure you have the correct parameters?
  • Open your component/page and confirm they do not have any problems
  • Open your menu, and bar item, confirm they are correct
  • Check your menu/component search records if you are passing parameters search parameters.

One way this can happen is if the search record has been overridden at the menu level and the search record does not exist/has not been built in application designer. A trace may not necessarily tell that the record is missing/not built in this case either. So check your menu search record and your component search record both exist.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License