How To Add A Descriptive Flexfield (DFF) in A Custom Oracle Apps Form
How To Add A Descriptive Flexfield (DFF) in A Custom Oracle Apps Form
form
Step 1: Create the custom table
We have created a custom table with the following script,
Once the table registration API completes successfully, log in to Oracle Apps.
Title: Blacklist
Table Application: Custom Applications
Name: BLACKLIST_FLEX
DFV View Name: (This value is left blank. If we set up a database view later on we
shall add its name here)
Click on Columns
The list of columns are displayed here. If the box named, Enabled, is checked
then the column is set to be part of DFF. Notice that Oracle has checked the
ATTRIBUTE columns as DFF by default. If you want to add any column, you may
check the Enabled box.
Note:
The column ATTRIBUTE_CATEGORY is not displayed in this list of columns as is
already declared as the DFF Structure column in the previous screen.
Close this form and go back to Descriptive Flexfields form.
Click on Reference Fields
The list of reference fields are displayed here. We do not have any at the
moment. Save and close the DFF form.
Number: 10
Then Freeze the flexfield by checking the box on the main DFF Segments form.
Save the form so that Oracle compiles the DFF. Once the compilation is over the
DFF is ready to be used.
Required: No
Canvas: <Set the name of the Canvas manually since the item was created
manually>
Database Item: No
IS
BEGIN
THEN
);
ELSE
NULL;
END IF;
END;
Now we need to add the call to this function when the form is initiated.
Therefore we need to call the procedure from WHEN-NEW-FORM-INSTANCE.
Open the WHEN-NEW-FORM-INSTANCE trigger.
Add the following line to call the inbuilt procedure,
xx_supplier_blacklist_dff (‘WHEN-NEW-FORM-INSTANCE’);
Finally we need to raise the event to call the DFF when the DFF field is clicked on.
This will ensure that the DFF segments will be displayed.
Note:
Oracle apps provides the API named, FND_FLEX, for Descriptive flexfield events. You
can to write all the block level triggers to have consistent normal behaviour of the
descriptive flexfield.
WHEN-VALIDATE-ITEM: FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM ‘);
PRE-QUERY: FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY: FND_FLEX.EVENT(‘POST-QUERY’);
WHEN-VALIDATE-ITEM: FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
WHEN-NEW-ITEM-INSTANCE: FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);
PRE-INSERT: FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE: FND_FLEX.EVENT(‘PRE-UPDATE’);
You will find a new procedure in the Program Units section
IS
BEGIN
IF (event = ‘WHEN-NEW-FORM-INSTANCE’)
THEN
);
ELSE
NULL;
END IF;
END;
This procedure has been generated by Oracle for invoking the flex field window
and its functionality.
Form: XX_SUPPLIER_BLACKLIST
Function: XX_SUPPLIER_BLACKLIST
Properties Tab
Type: Form
Form Tab
We would like to access the form from the responsibility named, IN AP Manager
(HO). Let us open the responsibility form.
Responsibility: System Administrator
Enter,
Seq: 55
Prompt: Blacklist
Save and close the form. You will get a popup message saying that the menu us
being recompiled. Now the form function is attached to the menu and will be
accessible to us from the responsibility.
function.
The form opens up. Now click on the DFF field on the bottom right.
Now the DFF form has also opened. Let us enter some values in the form as
shown below.
Save the form. Query the data from the table and let us see if the data has been
entered properly into the attribute columns. In this case we have setup only
ATTRIBUTE1 as the DFF segment (Step 2).
ID => ‘GL_CODE_COMBINATIONS’,
VRULE=>’\\nSUMMARY_FLAG\\nI\\nAPPL=SQLGL;NAME=GL_NO_PARENT_SEGME
NT_ALLOWED\\nN’, where_clause => ‘summary_flag != ”Y”’, QUERY_SECURITY
=>’Y’);
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
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’)