Title: Oracle Applications FND Packages
1Oracle Applications FND Packages
- Linda Jillson
- Manager
- ljillson_at_braunconsult.com
2FND Package Functionality
- Security
- Messaging
- User Profiles
- Concurrent Processing
- File I/O
- Concurrent Program and Request Set Loaders
3Security Functionality
- FND_Function
- Function Definition
- A part of an applications functionality that is
registered under a unique name for the purpose of
assigning it to , or excluding it from, a
responsibility. I.e. A Form - Test for responsibilitys permissions to execute
a function - Execute a function within the constraints of the
responsibility - Used in Forms program units, or database
procedures called from Forms
4FND_Function.Test
- Function
- Returns TRUE if function is accessible, otherwise
FALSE - Tests to see if a function is accessible by the
current responsibility - Often used in When-New-Form-Instance trigger to
determine which buttons to enable or disable - Usage
- if FND_Function.Test(FUNCTION_NAME) then
- / execute code for success /
- else
- / execute code for failure /
- end if
5FND_Function.Query
- Procedure
- Check to see if a function is accessible, and
retrieve information about the function - Usage
- FND_Function.Query(Function_Name,
- lAccessible,
- cType,
- cPath,
- cArgList)
6FND_Function.Execute
- Procedure
- Executes the specified Form
- Only accessible from Client-side PL/SQL
- Should be used in place of Oracle Forms built-ins
OPEN_FORM and NEW_FORM - Usage
- FND_Function.Execute(Function_Name, Y, Y,
- NULL, ACTIVATE)
7FND_Function.User_Function_Name
- Function
- Returns the User Name of the specified function
- Usage
- cUserName FND_Function.User_Function_Name(MYFU
NC)
8FND_Function.Current_Form_Function
- Function
- Returns the function name with which the current
form was called - Usage
- cCallingFunc FND_Function.Current_Form_Function
9Messaging Functionality
- FND_Message
- Manipulate messages defined in the Message
Dictionary - Client and Server-side procedures place messages
on the message stack or in the global area - Client-side procedures retrieve messages from the
stack and display them from the currently running
form
10Retrieve and Set Up Messages - Client Side
11Retrieve and Buffer Messages - Server Side
12Displaying Messages - Client Side
13Displaying Messages from Concurrent Programs
14FND_Message Examples
/ Display an error message with translated token
/ FND_Message.Set_Name (MYAPPL,
MY_ERR_MESSAGE) FND_Message.Set_Token(PROCEDUR
E,
TRANS_PROC_NAME, TRUE) FND_Message.Error
/ Display a message with 2 buttons, use Caution
icon / FND_Message.Set_Name(MYAPPL,
DELETE_ALL) nButton FND_Message.Question(DE
LETE, NULL, CANCEL,
1, 3,
caution)
15FND_Message Examples (continued)
- / Retrieve message from server and display /
- FND_Message.Retrieve
- FND_Message.Error
- / Server side code example /
- FND_Message.Set_Name(MAPPL, MY_ERR_MSG)
- FND_Message.Set_Token(PROCEDURE,
- My
Procedure) - APP_Exception.Raise_Exception
16User Profile Functionality
- FND_PROFILE
- Retrieve user profile values for the current
run-time environment - Set user profile values for the current run-time
environment
17FND_Profile.Put
- Procedure
- Assign a value to the specified user profile
option - Usage
- FND_Profile.Put(PROFILE_NAME, NEW VALUE)
18FND_Profile.Get
- Procedure
- Retrieve the current profile option value
- Usage
- FND_Profile.Get(PROFILENAME, cValue)
19FND_Profile.Value
- Function
- Returns a character string
- Retrieves the current value of the specified user
profile option - Usage
- cValue FND_Profile.Value(PROFILEOPTION)
20Concurrent Processing Functionality
- FND_REQUEST
- Submit concurrent requests
- FND_CONCURRENT
- Retrieve information about concurrent requests
- Set information about concurrent requests
21FND_Request Objects
22FND_Concurrent Objects
23Concurrent Processing Example
- Procedure Main(ErrBuf OUT varchar2, RetCode OUT
varchar2) is - / From MetaLink Technical Forum, Note 73492.1 /
- cErrBuf varchar2(2000)
- cPhase varchar2(2000)
- cstatus varchar2(2000)
- cDevPhase varchar2(2000)
- cDevStatus varchar2(2000)
- cMessage varchar2(2000)
- nRequestID number
- lRequestStatus boolean
- BEGIN
- RetCode 0 / Initialize RetCode for Normal
completion / - nRequestID FND_Request.Submit_Request(MYAPP
L, MYPROG, -
Request Submitted from Main) - commit
-
24Concurrent Processing Example (continued)
- if nRequestID 0 then
- cErrBuf Request Submit was not
successful - RetCode 1 / This request completes
with Warning / - else
- cErrbuf Request ID is
to_char(nRequestID) - lRequestStatus FND_Concurrent.Wait_For_Re
quest(nRequestID, 60, 0, - cPhase, cStatus, cDevPhase,
cDevStatus, cMessage) - if cDevStatus ERROR then
- cErrbuf Submitted Request failed.
Message cMessage - RetCode 2 / This request
completes with Error / - else
- cErrBuf Submitted Request
successfully complete. Status cStatus - end if
- end if
- ErrBuf cErrBuf
- END
-
25File I/O Functionality
- FND_FILE
- Allows PL/SQL procedures, running as concurrent
requests, to write information to the concurrent
request log and out files - Uses the Oracle supplied database package
UTL_FILE - utl_file_dir parameter must be set to include the
log and out directories for the applications that
will run concurrent requests using FND_FILE - Database owner must have write privileges on
those directories
26FND_File.Put
- Procedure
- Writes text to log or out file
- Does not include new line character
- Usage
- FND_File.Put(FND_File.Log, This text written to
Log file)
27FND_File.Put_Line
- Procedure
- Writes text to log or out file
- Does include new line character after writing
text - Usage
- FND_File.Put_Line
(FND_File.Out, This text
written to Out file)
28FND_File.New_Line
- Procedure
- Writes new line character(s) to specified file
- Used with FND_File.Put
- Usage
- FND_File.New_Line(FND_File.Log, 2)
29FND_File.Put_Names
- Procedure
- Sets temporary log and out file names and
directory - Used only during test and debug phase
- Usage
- FND_File.Put_Names(R999.log, R999.out,
/usr/temp/outfiles)
30FND_File.Close
- Procedure
- Closes files opened for write
- Used only during test and debug phase
- Usage
- FND_File.Close
31FND_File Output Example
32Concurrent Program and Request Set Loader
Functionality
- FND_Program and FND_Request
- Used to programmatically create
- Concurrent executables
- Concurrent Programs
- Parameters for Concurrent Programs
- Concurrent Request Sets
- Recommended when maintaining multiple instances
(i.e. development, test, production)
33FND_Program Functionality
- Most procedures correspond to functionality
provided by System Administration forms
- Others allow for checking for the existence of
programs and components, and deleting existing
programs and components - Use FND_Program.Message to display error messages.
34FND_Set Functionality
- Most procedures correspond to functionality
provided by System Administration forms
- Others allow for checking for the existence of
sets and components, and deleting existing sets
and components - Use FND_Set.Message to display error messages.
35References
- Oracle Applications Developers Guide (Release
11) - MetaLink
36Questions or Comments?