Difference between Transfer, TransferPage and DoModalComponent

 

Difference between Transfer, TransferPage and DoModalComponent

1.       Transfer - The PeopleCode ‘Transfer’ function is used for transferring the user from component A to component B. All control is passed to component B; component A is closed completely.

 

2.       TransferPage() - ‘Transfer’ should not be confused with the ‘TransferPage’ function. The latter function is only used to transfer from one page to another within the same component.

 

3.       DoModalComponent() - This is used to open a secondary component in a modal window while still keeping the original component held in memory. The secondary component must be completed and dismissed before the user can resume working in the original component. ‘Transfer’ on the other hand, works as a one-way street.

 

Challenges - The ‘Transfer’ function can be quite a challenge to get right, mainly due to three things. Firstly, the function allows for a large number of parameters, so it is easy to get the parameters in the wrong order, or miss out on one or more of the parameters entirely. Secondly, some of the parameters are not what they seem at first glance. Thirdly, even after crafting a perfect ‘Transfer’ statement, you might find some or all of your users lack the correct security for the target component.

Syntax – Mandatory Parameters

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

Each of these parameters will next be considered in turn:

Open New Browser Window – this True/False value indicates whether a new browser window should be opened. ‘True’ indicates that a new window should be opened while ‘False’ will keep the target component in the current window.

Menu Name – the name of the menu containing the target component.

Bar Name – a PeopleSoft menu is divided into functional groups, typically called ‘Use’, ‘Process’ and ‘Setup’ (a hangover from the pre-Portal days when the menu played more of a role). To work out the Bar Name, open the menu in App Designer and double-check on the Bar Name at the top of the menu. You should see two pieces of information: Name and Label. These are usually set to the same value, but in case they aren’t, it is the ‘Name’ field that is required for the ‘Transfer’ command.

Item Name – this one can be confusing, especially for older components. In the majority of cases, the Item Name is the same as the component name. However, strictly speaking, the ‘Item Name’ is the name of the item as it appears on the menu. This defaults to the component name, but can be changed in App Designer. To check the correct Item Name, double-click on the menu item and make a note of the Menu Item ‘Name’ field at the top of the properties window. In the example below, the ‘Menu Item Name’ and the ‘Component Name’ are the same:

Page – similar to Item Name, this is another one that can catch the unwary. In most cases, the Page Name required for the ‘Transfer’ command is the usual name of the page object. However, at the component level, it is possible to set a page ‘Item Name’ to a different value from the object name. For the purposes of the ‘Transfer’ command, you must enter the ‘Item Name’ as it appears in the component. In the following example, pages 1 and 5 have a different Item Name to the object page Name.

Mode – this parameter specifies the manner in which the target component should be opened. The value of this parameter can be entered as a single letter (“A”) or as a Constant Value (‘%Action_Add’). Typical values for the mode are A / ‘%Action_Add’, U / ‘%Action_UpdateDisplay’, and C / ‘%Action_Correction’. While setting this parameter is straightforward enough, often users are caught out by security. You might specify a ‘Transfer’ in correction mode, but when a particular user tries to access the target component, you then discover that the user does not have correction access to that component. In this case, an error message is displayed. Therefore, user security should always be kept in mind when specifying the ‘Mode’.

Transfer and TransferExact

Finally – yes, we are almost at the end – one other ‘quick’ about the ‘Transfer’ search is worth mentioning. When the ‘Transfer’ attempts to do the search based on the passed parameters, it will do a ‘LIKE’ search on all the string parameters. If however, you prefer the system to do an exact match on the passed parameters, which will always be quicker than a ‘LIKE’ search, then use the ‘TransferExact’ function instead. As long as you have provided the function with all the necessary values, ‘TransferExact’ will deliver a faster response time.

No comments:

Post a Comment

PeopleCode to retrieve Google map between two addresses

  PeopleCode Example: /* Define constants for the API request */ Local string &origin = "123 Main St, Anytown, USA";   /* ...