Sei sulla pagina 1di 4

Implementing DFF in Form consist of two steps Process.

The first steps consist o


f designing the table structure and registration and step 2 consist of enabling
in the form.
Steps 1:
Define DFF fields in the custom tables
ATTRIBUTE1ATTRIBUTE15 and ATTRIBUTE_CATEGORY are the normal fields used for D
FF
Register the table with Oracle AOL
Register the DFF with Oracle AOL
For this you have to login into application with :
Application Developer -> Flex Field -> Descriptive -> Register
Then you should specify the name of the DFF (Say BTL_AR_DFF) and specify the
associated table.
Step 2:
Create DFF fields in the custom form
1. Create a form based on the custom table
Copy TEMPLATE form has example descriptive flexfield which we can use
Use the TEXT_ITEM_DESC_FLEX property class
Attach ENABLE_LIST_LAMP_LOV for the field
2. Create a non-base table text item in the block with property class TEXT_I
TEM_DESC_FLEX
3. Make sure that DFF is mapped to fields (ATTRIBUTE) of the table and is en
abled.
Next is to call Flexfield Routines to add DFF built-ins in the form to invok
e DFF.
This consist of these steps:
1. Write, a form level trigger WHEN-NEW-FORM-INSTANCE to invoke the DFF as
FND_DESCR_FLEX.DEFINE(
Block => 'Name of the DFF block',
Field => 'BTL_DFF',
Appl_short_name => 'AR',
Desc_flex_name => 'BTL_AR_DFF',
Title => 'BPL AR More Info' );
2. Write, block level triggers PRE-QUERY and POST-QUERY as
FND_FLEX.EVENT('PRE-QUERY');
FND_FLEX.EVENT('POST-QUERY');
FND_FLEX.EVENT('Pre-Query');
FND_FLEX.EVENT('When-Validate-Record');
FND_FLEX.EVENT('Post-Query');
FND_FLEX.EVENT('When-New-Item-Instance');
FND_FLEX.EVENT('Pre-Insert');
FND_FLEX.EVENT('When-Validate-Item');
FND_FLEX.EVENT('Pre-Update ');
These are the steps required to implement KFF in customization.
Define KFF fields in your database tables.
The custom table should contain a field named as XXX_ID (where XXX means the
entity. For ex. PART_ID, CODE_COMBINATION_ID etc) to capture the selected code
combination ID.
Register the table with Oracle AOL.
Register the KFF with Oracle AOL
Logon as
Application Developer -> Flex fields -> Key -> Register
Existing KFF can also be used. Ex. Accounting FF
Create KFF in the custom form
1. Create a form based on the custom table.
2. In the block, create two non-base table text items of data type CHAR (2000).
One text item is to store the code combinations (Say BTL_KFF ) and other one is
to store description of the code (Say BTL_KFF_DESC. Make this item as non-update
able).
Add KFF standard built-ins in the form to invoke KFF
The custom table should contain a field named as XXX_ID (where XXX means the
entity. For ex. PART_ID, CODE_COMBINATION_ID etc) to capture the selected code
combination ID.
this is typical registration of KFF. For Customization in custom development her
e are the steps:
1. Write a form level trigger WHEN-NEW-FORM-INSTANCE to invoke the KFF as
Fnd_Key_Flex.Define(
Block => block_name,
Field => concatenated_segments_field_name,
[Description => description_field_name,]
[ID => Unique_ID_field
Appl_Short_Name => application_short_name,
Code => key_flexfield_code,
Num => structure_number,
In above defination take a note,
These arguments specify location
All fields must reside in same block
ID is for Key Flexfields only
These arguments indicate which flexfield is being used
Short name is application where flexfield is registered
SQLGL is Oracle General Ledger
SQLAP is Oracle Payables
Code identifies Key Flexfield
GL# is Accounting Flexfield
Num is Key Flexfield structure number. Default is 101
Usage
FND_KEY_FLEX.DEFINE(
block => Custom block ,
Field => BTL_KFF ,
Description => BTL_KFF_DESC ,
ID => XXX_ID ,
Appl_short_name => SQLGL ,
Code => GL# ,
Num => 101 ,
Vrule => GL_GLOBAL\nDETAIL_POSTING_ALLOWED \nE\nAPPL= SQLGL ;
name=Parent Values are not allowed\nN
);
2. XXX_ID will store the code combination ID for each selection.
3.Invoke Flexfield functionality by calling FND_Flex.Event(event) from:
PRE-QUERY
POST-QUERY
PRE-INSERT
PRE-UPDATE
WHEN-VALIDATE-RECORD
WHEN-NEW-ITEM-INSTANCE
WHEN-VALIDATE-ITEM

3. Write an item level trigger WHEN-NEW-ITEM-INSTANCE on BTL_KFF as


FND_FLEX.EVENT( WHEN-NEW-ITEM-INSTANCE )
4. Write an item level trigger KEY-EDIT on BTL_KFF as
FND_FLEX.EVENT( KEY-EDIT );
5. Write an item level trigger WHEN-VALIDATE-ITEM on BTL_KFF as
FND_FLEX.EVENT( WHEN-VALIDATE-ITEM );
IF :CUSTOM_BLOCK.XXX_ID = -1 THEN
FND_MESSAGE.SET_STRING( You Have Selected An Undefined Code Combination ! );
FND_MESSAGE.SHOW;
RAISE FORM_TRIGGER_FAILURE;
END IF;
These steps makes you flexfield enable in your form.
A NOTE FOR FLEX FIELD DEFINATION
Lets take a close scan to understand some of the paramater used in Flex Field de
fination.
1. [Validate=> {FOR_INSERT|FULL|PARTIAL|NONE|PARTIAL_IF_POSSIBLE},]
This is used only for Key FlexFields only
For_Insert used in a block where the code_combinations table is the base table
Full used where the code_combination_id is a foreign key in the base table
None when any value is allowed, such a range flexfield for query purposes
Partial validates segment values but not the full combination
Partial_If_Possible only used when the flexfield has dependent segments
2.[Vdate => date,]
Validation date compared to segment value start/end dates
3.[Required=>[Y|N,]
This is applicable only in the case for key flexfields only
Y requires user to enter a valid value for every required segment, even if the
flexfield is never navigated to
N only requires required segments to be entered when the flexfield has been up
dated
4.[Displayable => {ALL | flexfield_qualifier | segment_number} [\0{ALL|flexfield_
qualifier|segment_number}],]
Key Flexfields only. Default is ALL
Naming flexfield qualifier or segment number causes only those segments to a
ppear.
Toggle this parameter by specifying more than one value separated with \0
Display all but the first segment by specifying:
DISPLAYABLE=>ALL\01
Same parameters for Updateable and Insertable
5.[COPY=>block.field\n{ALL|flexfield qualifier|segment number} [\0block.field\n{A
LL|flexfield qualifier|segment number}],]
Again, key flexfields only.
Copy a form field value into the segment indicated by flexfield qualifier or
segment number
Value must be valid for segment or it will be erased
Copy works in reverse when flexfield pop-up window closes
Example copies a form global variable into the natural account segment of th
e Accounting Flexfield:
COPY=>GLOBAL.default_expense_obj\nGL_ACCOUNT
6.[VRULE => flexfield qualifier\n
segment qualifier\n
{I[nclude] | E[xclude]}\n
APPL=application_short_name;
NAME=Message Dictionary message name\n
Validation value1\n
Validation value2
[\0flexfield qualifier\n

Key or range flexfields


Impose additional validation
\n is delimiter between parameters
\0 is delimiter between groups of parameters

Potrebbero piacerti anche