Previous  Next          Contents  Index  Navigation  Glossary  Library

CUSTOM.EVENT

Summary

procedure custom.event(event_name varchar2);

Description

This procedure allows you to execute your code at specific events. Always test for event name, then for form and block name within that event. Refer to the SYSTEM variables for form name and block name in your code and branch accordingly. The module name of your form must match the form file name.

Always use FND_FUNCTION.EXECUTE to open a new session of a form. Do not use CALL_FORM or OPEN_FORM. The form function must already be defined with Oracle Application Object Library and added to the menu (without a prompt, if you do not want it to appear in the Navigator).

Additional Information: Oracle Applications Developer's Guide

By default, this routine must perform "null;".

Attention: Oracle Corporation reserves the right to pass additional values for event_name to this routine, so all code must be written to branch on the specific event_name passed.

Example Code

The following example contains logic for a Zoom, a product-specific event, and a generic form event.

The Zoom event opens a new session of a form and passes parameter values to the new session. The parameters already exist in the form being opened, and the form function has already been defined and added to the menu (without a prompt, so it does not appear in the Navigator).

procedure event(event_name varchar2) is  
 
    form_name      varchar2(30) := name_in('system.current_form');
    block_name     varchar2(30) := name_in('system.cursor_block');
    param_to_pass1 varchar2(255);  
    param_to_pass2 varchar2(255);  
  begin  
    if (event_name = 'ZOOM') then    
      if (form_name = 'DEMXXEOR' and block_name = 'ORDERS') then
        /* The Zoom event opens a new session of a form and  
        passes parameter values to the new session.  The
        parameters already exist in the form being opened:*/
        param_to_pass1 := name_in('ORDERS.order_id');  
        param_to_pass2 := name_in('ORDERS.customer_name');  
        fnd_function.execute(FUNCTION_NAME=>'DEM_DEMXXEOR',   
                             OPEN_FLAG=>'Y',   
                             SESSION_FLAG=>'Y',   
                             OTHER_PARAMS=>'ORDER_ID="'||
                             param_to_pass1||  
                             '" CUSTOMER_NAME="'||
                             param_to_pass2||'"');  
         /* all the extra single and double quotes account for
         any spaces that might be in the passed values */
      end if;  
    else  
      null;  
    end if;  
  end event;  
end custom; 

See Also

Customizing Oracle Applications with the CUSTOM Library

Writing Code for the CUSTOM Library

Events Passed to the CUSTOM Library

When to Use the CUSTOM Library

CUSTOM Library Package Procedures

Coding Zoom

Support and Upgrading

Example of Implementing Zoom Using the CUSTOM Library


         Previous  Next          Contents  Index  Navigation  Glossary  Library