Calling messages: Following standard procedure can be called to show predefined oracle applications message through forms or concurrent programs.

FND_MESSAGE.CLEAR – Clears the message stack of all the messages.

FND_MESSAGE.DEBUG – Immediately displays the string passed to it as input parameter.

FND_MESSAGE.ERASE – Clears the oracle Forms status line.

FND_MESSAGE.ERROR – Displays an error message in an Oracle Forms modal window or a concurrent program log file. (Example: “Invalid value entered.”). It takes its message from the stack, displays the message, and then clears all the messages from the message stack.

FND_MESSAGE.GET – Retrieves a translated and token–substituted message from the message stack and then clears that message from the message stack. This could be used for getting a translated message for a forms built–in or other function. Assumes you have already called FND_MESSAGE.SET_NAME and, if necessary,
FND_MESSAGE.SET_TOKEN. It returns up to 2000 bytes of message.

FND_MESSAGE.HINT – Displays a message in the Oracle Forms status line. It takes its message from the stack, displays the message, and then clears that message from the message stack. The user may still need to acknowledge the message if another message immediately comes onto the message line.

FND_MESSAGE.QUESTION – Displays a message and up to three buttons in an Oracle Forms modal window. (Example: “Please choose one of the following actions: ”) It takes its message from the stack, and clears that message. After the user selects a button, It returns the number of the button selected.
For each button, you must define or use an existing message in Message Dictionary (under the Oracle Application Object Library application) that contains the text of the button. This routine looks for your button name message in the Oracle Application Object Library messages, so when you define your message, you must associate it with Oracle Application Object Library (the “FND” application) instead of your application.

FND_MESSAGE.RETRIEVE – Retrieves a message from the database server, translates and substitutes tokens, and sets the message on the message stack.

FND_MESSAGE.SET_NAME – Retrieves your message from Message Dictionary and sets it on the message stack. You call it once for each message you use in your client–side PL/SQL procedure. You must call this procedure before you call FND_MESSAGE.SET_TOKEN.

FND_MESSAGE.SET_STRING – Takes an input string and sets it directly on the message stack. The string does not need to be defined in the Messages window. These strings may be hard coded into the form and are not translated like messages defined in Message Dictionary.

FND_MESSAGE.SET_TOKEN – Substitutes a message token with a value you specify. You call FND_MESSAGE.SET_TOKEN once for each token/value pair in a message. The optional translate parameter can be set to TRUE to indicate that the value should be translated before substitution. (The value should be translated if it is, itself, a Message Dictionary message name.)

FND_MESSAGE.SHOW – Displays an informational message in an Oracle Forms modal window or a concurrent program log file. (Example: “To complete this function, please enter the following… ”). It takes its message from the stack, displays the message, and then clears only that message from the message stack.

FND_MESSAGE.WARN – Displays a warning message in an Oracle Forms modal window and allows the user to either accept or cancel the current operation. (Example: “Do you wish to proceed with the current operation?”) FND_MESSAGE.WARN returns TRUE if the user accepts the message (that is, clicks OK), or FALSE if the user cancels. It takes its message from the stack, displays the message, and clears that message from the message stack.
Most frequently used procedures are FND_MESSAGE.SET_NAME and FND_MESSAGE.SET_TOKEN

Example
/*Here FND_MESSAGE.SET_NAME is used to retrieve the message and put it on the message stack. Message name is ‘WANT TO CONTINUE’.*/

FND_MESSAGE.SET_NAME (’FND’, ‘WANT TO CONTINUE);

/*Next FND_MESSAGE.SET_TOKEN is used to replace the token ‘PROCEDURE’ with text ‘Compiling this flexfield’.

FND_MESSAGE.SET_TOKEN (’PROCEDURE’, ’Compiling this flexfield’);

IF FND_MESSAGE.WARN THEN
/* User want to continue */

ELSE
/* User want to cancel*/

END;

Requirement: From OAF page i have to call a custom procedure for some activity.

Solution:
Create a button through OAF personalization like below. Concurrent program name is XXPRCTEST. I register this under Application Developer.

ID: TestBtn
Prompt: Submit Report
OA.jsp?akRegionCode=FNDCPPROGRAMPAGE&akRegionApplicationId=0&programApplName=FND&programRegion=Hide&scheduleRegion=Hide¬ifyRegion=Hide&printRegion=Hide&&programName=XXPRCTEST
Target Frame: _blank

This will open a new submit window.

Libraries – Core

($) Download from $AU_TOP/resource
($) Set FORMS60_PATH on desktop to location of local libraries
($) APPCORE.pll Application Standards, toolbar
   VERT.pll Specific industry features
   GLOBE.pll Global or regional features
     JA.pll Asia/Pacific features
     JE.pll Europe/Middle East/Africa features
     JL.pll Latin America Code
   CUSTOM.pll Customizations of standard forms
($) FNDSQF.pll Flexfields, Profiles, Currency, Concurrent Request Submission, Record History, Message Dictionary
($) APPDAYPK.pll Calendar
($) APPFLDR.pll Packages for Folder Blocks

Libraries – Application Specific

($) Additional libraries attached to TEMPLATE.fmb
($) All libraries are available in $AU_TOP/resource
($) FV.pll Federal Financials
($) HRKPI.pll Human Resources Knowledge Provider
($) GHR.pll Global Human Resources
($) GMS.pll Encumbrances
($) IGILUTIL.pll International Public Sector
($) IGILUTIL2.pll International Public Sector
($) PSAC.pll Public Sector Applications
($) PQH_GEN.pll Public Sector Human Resources
($) PSA.pll Public Sector Applications
($) PSB.pll Public Sector Budgeting
($) OPM.pll Process Manufacturing
($) APPCORE2.pll Application standards (for CUSTOM.pll)
($) List of application specific libraries are not all inclusive
($) Additional libraries are attached based on your implementation
   Multiple Countries
   Oracle Industry Applications
($) Oracle does not support the use of APPFLDR, VERT, GLOBE, PSAC, PQH_GEN, GHR, JA, JE and JL for custom forms


($) *NEVER MODIFY ORACLE APPLICATIONS LIBRARIES OTHER THAN CUSTOM.pll*


APPCORE: APPCORE contains the packages and procedures that are responsible for the standard ‘Oracle Applications’ behavior of the forms. The forms have to support the menu, toolbar, and other required standard behaviors in compliance with oracle applications. The Oracle Applications forms also have to display specific runtime behaviors in accordance with the Oracle Applications Interface Standards, such as the way in which fields are enabled, behaviors of specific types of windows etc. APPCORE contains the procedures to support this standard runtime behavior. APPCORE also contains various other utilities for exceptional handling, message levels, and so on.


GLOBE: The GLOBE library allows Oracle Applications developers to incorporate global or regional features into Oracle Applications forms
without modification of the base Oracle Applications form. Oracle Applications sends events to the GLOBE library. Regional code can
take effect based on these events. The GLOBE library calls routines in
the JA, JE, and JL libraries.


JE: The JE library contains code specific to the EMEA (Europe/ MiddleEast/ Africa) region and is called by the GLOBE library.


FNDSQF: FNDSQF contains packages and procedures for Message Dictionary, flexfields, profiles, and concurrent processing. It also has various other utilities for navigation, multicurrency, WHO, etc.


JL: The JL library contains code specific to the Latin America region and is called by the GLOBE library.


JA: The JA library contains code specific to the Asia/Pacific region and is called by the GLOBE library.


VERT: The VERT library allows Oracle Applications developers to incorporate vertical industry features (for automotive, consumer packaged goods, energy, and other industries) into Oracle Applications forms without modification of the base Oracle Applications form. Oracle Applications sends events to the VERT library. Vertical industry code can take effect based on these events. The VERT library calls routines in various other libraries.


GHR: The GHR library contains code specific to Event Dispatcher  for HRMS Localization

APPCORE2: There is no basic difference between appcore.pll and appcore2.pll. Appcore2.pll is a replica of appcore.pll. While using custom.pll we can’t reference appcore.pll as it cause cross reference problem so to use appcore.pll in custom.pll we make use of appcore2.pll


HRKPI: This HRKPI library contains packages for humary resource knowledge provider. If the HR_STAND is attached with the form, then this may be must.
PQH_GEN.pll The PQH_GEN library contains code specific to Public Sector Human Resources
PSAC.pll The PSAC library contains code specific to Public Sector Applications
PSB.pll The PSB library contains code specific to Public Sector Budgeting
PSA.pll The PSA library contains code specific to Public Sector Applications
GMS.pll The GMS library contains code specific to Encumbrances
FV.pll The FV library contains code specific to Federal Financials

IGILUTIL.pll The IGILUTIL library contains code specific to International Public Sector

IGILUTIL2.pll The IGILUTIL2 library contains code specific to International Public Sector

OPM.pll The OPM library contains code specific to Process Manufacturing

Overview of the Template Form

The TEMPLATE form is the starting point for all development of new forms. The first step in creating a form for use in Oracle Applications is to copy the template form from $AU_TOP/forms/US, to a local directory and renaming it.

The Template form is unique because it contains some special libraries and triggers that render the application using the template form some standard characteristics. The components of the template form are:

  • References to object groups: The template form contains platform–independent references to predefined standard object groups in the APPSTAND form(STANDARD_PC_AND_VA,STANDARD_TOOLBAR, and STANDARD_CALENDAR).
  • Libraries: The template form contains platform–independent attachments of several libraries (including FNDSQF, APPCORE, and APPDAYPK).
  • Special triggers: The template form contains several form–level triggers with required code. These are responsible for standard the behavior of the form.
  • Predefined Program Units: The template form contains predefined program units that include a spec and a body for the package APP_CUSTOM, which contains default behavior for window opening and closing events.
  • Applications Color Palette: The template form contains the application color palette. This gives the forms developed using the template form the look and feel of Oracle applications.
  • Many referenced objects (from the object groups) that support the Calendar, the toolbar, alternative regions, and the menu. These objects include LOVs, blocks, parameters, and property classes, and so on.
  • The TEMPLATE form contains sample objects that can be seen as examples for the expected layout cosmetics. These samples can be completely removed from theform later as they are only examples and are not required. The following objects are the samples and can be removed:
    • Blocks: BLOCKNAME, DETAILBLOCK
    • Window: BLOCKNAME
    • Canvas–view: BLOCKNAME
Hence, the template form comes along with many attachments, predefined program units, and defined visual attributes as well as examples that not only give the forms that are developed using the template.fmb a standard look and feel, but also make it easier to develop forms with consistent and standard functionality.
FND_GLOBAL.APPS_INITIALIZE is used for initializing the session before calling any public or private API’s in Oracle Ebusiness suite. Its not required for all the API’s but its recommended that you set this profile before making any calls to either private or public API. 


Listed below is a sample call to FND_GLOBAL.APPS_INITIALIZE function


fnd_global.APPS_INITIALIZE(user_id=>l_user_id, 
                           resp_id=>l_resp_id, 
                           resp_appl_id=>l_resp_appl_id);


l_user_id is the fnd user ID which will be utilized during the call. 
l_resp_id is the responsibility ID 
l_resp_appl_id is the responsibility application ID. 
You can use either sysadmin or use some user who has all the above listed responsibilities.


For SYSADMIN, utilize the following query to get the respective values


select fnd.user_id , 
       fresp.responsibility_id, 
       fresp.application_id 
from   fnd_user fnd 
,      fnd_responsibility_tl fresp 
where  fnd.user_name = ‘SYSADMIN’ 
and    fresp.responsibility_name = ‘Order Management Super User’;


Another option is Help > Diagnostics > Examine and get the values from $profile session values.