PLSQL Block Custom Menu Sample

This custom menu executes an anonymous PL/SQL block. It provides the possibility to use context substitution variables and column values in the client within the PL/SQL block as bind variables. The section How to use form data in parameters explains how to use values as parameters. The custom menu does not write the result of the PL/SQL block to the client. This custom menu can be executed on both single and multiple rows. 

Use this custom menu to execute PL/SQL transactions that don't exist in the standard client code.

Contents

Define the Custom Menu

  1. Open the page Solution Manager/User Interface/Custom Objects/New Custom Menu.
  2. Enter the window where you will use the custom menu.
  3. Enter the menu title. This is the text that will be shown in the pop-up menu.
  4. Set Action Type to PL/SQL Block.
  5. Enter the PL/SQL code in the action parameters pane.
  6. Enter the presentation object to control security for the custom menu. If you do not want to use security, do not enter a presentation object.
  7. Press Save button to save the custom menu.

How to write the PL/SQL Block

When you write the PL/SQL block you should follow the same rules as you do when using the IFS Client framework method DbPLSQLTransaction. Enter the PL/SQL statements but leave out the keywords BEGIN, END and EXCEPTION, since these are automatically added. The recommendation is to make calls to PL/SQL procedures in the server that handle all the logic. The PL/SQL block has a limit of 4000 characters. Here is a simple example: &AO.Purchase_Order_Approval_API.Authorize(&ORDER_NO, &SEQUENCE_NO, &APPROVER_SIGN, &AUTHORIZE_GROUP_ID);

 

Refresh Window after execution

The window where the action is executed will automatically be refreshed after the PL/SQL block is executed. So all data will be repopulated from the server. This is the default behavior. If the window does not need to or should not be refreshed then the "Refresh window after execution" option can be deselected.