0% found this document useful (0 votes)
2K views

How To Add A Descriptive Flexfield (DFF) in A Custom Oracle Apps Form

This document provides steps to add a descriptive flexfield (DFF) in a custom Oracle Apps form: 1. Create a custom table and register it in Oracle Apps. 2. Register the DFF in Oracle Apps, defining segments and columns. 3. Configure the form builder and develop a custom form with a DFF field. 4. Register the form and attach it to a menu for access. 5. Test the form functionality.

Uploaded by

Oracle developer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

How To Add A Descriptive Flexfield (DFF) in A Custom Oracle Apps Form

This document provides steps to add a descriptive flexfield (DFF) in a custom Oracle Apps form: 1. Create a custom table and register it in Oracle Apps. 2. Register the DFF in Oracle Apps, defining segments and columns. 3. Configure the form builder and develop a custom form with a DFF field. 4. Register the form and attach it to a menu for access. 5. Test the form functionality.

Uploaded by

Oracle developer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

How to add a Descriptive Flexfield (DFF) in a custom Oracle Apps 

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.

Responsibility: Application Developer

Navigation: Application > Database > Table

The query for the custom table, XX_USER_TABLE

Step 3: Register the DFF in Oracle Apps


Responsibility: Application Developer

Navigation: Flexfield > Descriptive > Register

Enter the values as,

Application: Custom Applications

Title: Blacklist
Table Application: Custom Applications

Name: BLACKLIST_FLEX

Description: Blacklist context flexfield

Table Name: XX_SUPPLIER_BLACKLIST

Context Prompt: Context Value

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.

Configure the DFF segments


Responsibility: Application Developer

Navigation: Flexfield > Descriptive > Segments

Query for the Title = Blacklist


Click on Segments

Create a new Segment

Number: 10

Name: Parent Supplier

Window Prompt: Parent Supplier

Click on Column to pull up the LOV with the columns

Select a column and a value set.

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.

Step 4: Configure Forms Builder


Forms builder has to be configured for developing Oracle Apps forms.

Step 5: Develop the custom form for Oracle Apps

We have created a new block named, XX_SUPPLIER_BLACKLIST. Add a new field


in the block for the DFF.
We have named the field, DFF.
The important properties to be set are,

Subclass Information: TEXT_ITEM_DESC_FLEX

Required: No

Canvas: <Set the name of the Canvas manually since the item was created
manually>

Database Item: No

Insert Allowed: Yes

Update Allowed: Yes

List of Values: ENABLE_LIST_LAMP

Validate From List: No

Notice the DFF text item on the canvas.


Now create a procedure in the form as given below,

PROCEDURE xx_supplier_blacklist_dff (event VARCHAR2)

IS

BEGIN

   IF (event = ‘WHEN-NEW-FORM-INSTANCE’)

   THEN

      fnd_descr_flex.define (BLOCK                         => ‘XX_SUPPLIER_BLACKLIST’, —


Name of the DFF

                             FIELD                         => ‘DFF’,

                             appl_short_name               => ‘CUSTOM’,

                             desc_flex_name                => ‘BLACKLIST_FLEX’

                            );

   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.

Create a trigger, WHEN-NEW-ITEM-INSTANCE, on the block


item named, DFF, and add the following line,
FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);

Save the form and compile it on the server.

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

The code in the procedure is,

PROCEDURE xx_supplier_blacklist_dff (event VARCHAR2)

IS

BEGIN

IF (event = ‘WHEN-NEW-FORM-INSTANCE’)

THEN

fnd_descr_flex.define (BLOCK => ‘XX_SUPPLIER_BLACKLIST’, — Name of the DFF

FIELD => ‘DFF’, — Field name

appl_short_name => ‘XXCUST’, — Custom Applications

desc_flex_name => ‘BLACKLIST_FLEX’

);

ELSE
NULL;

END IF;

END;

This procedure has been generated by Oracle for invoking the flex field window
and its functionality.

Step 6: Register the form


Now we need to register the form in Oracle Applications

Responsibility: Application Developer

Navigation: Application > Form

Enter the form details

Form: XX_SUPPLIER_BLACKLIST

Application: Custom Applications

User Form Name: Supplier Blacklist form

Description: Supplier Blacklist form

Register the form function

Navigation: Application > Function


Description Tab

Enter the following:

Function: XX_SUPPLIER_BLACKLIST

User Function Name: Supplier Blacklist Func

Description: Supplier Blacklist function

Properties Tab

Type: Form

Form Tab

Form: Supplier Blacklist form

Save and close the form. Now the form is registered.

Step 7: Attach the form function to a menu/responsibility


After the form and the form functions are created we need to attach the form
function to a menu that is attached to a responsibility. Once this is done the
form will be accessible to us from that responsibility and other responsibilities
which use that menu.

We would like to access the form from the responsibility named, IN AP Manager
(HO). Let us open the responsibility form.
Responsibility: System Administrator

Navigation: Security > Responsibility > Define

Query for responsibility, IN AP Manager (HO).

Note the Menu name. It is AP_NAVIGATE_GUI12.


Navigate to Application > Menu.

Query for User Menu Name = AP_NAVIGATE_GUI12.

Scroll down to the bottom of the lines and add a line.

Enter,

Seq: 55
Prompt: Blacklist

Function: Supplier Blacklist Func

Description: Supplier Blacklist Function

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.

Test the form


Log in to Oracle and go to the responsibility, IN AP Manager (HO) as we had
attached the form to the menu of this responsibility (Step 7).
Note the function, Blacklist, at the bottom of the navigation menu. Click on this

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).

How to use Key Flex Fields (KFF) in forms


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.
1. Create a form based on the custom table.
1. 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-updateable).
 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 here


are the steps:

1. Write a form level trigger WHEN-NEW-FORM-INSTANCE to invoke the


KFF as
FND_KEY_FLEX.DEFINE(

block => ‘XXBUC_FLEET_PLANNING’,

Field => ‘ACCOUNT_FLEXFIELD’,

Description =>  ‘DESC’,

ID => ‘GL_CODE_COMBINATIONS’,

Appl_short_name => ‘SQLGL’,

Code => ‘GL#’,

Num => ‘50608’,


–VRULE => ‘GL_GLOBAL\nDETAIL_POSTING_ALLOWED \nE\nAPPL=”SQLGL”;

VRULE=>’\\nSUMMARY_FLAG\\nI\\nAPPL=SQLGL;NAME=GL_NO_PARENT_SEGME
NT_ALLOWED\\nN’, where_clause => ‘summary_flag != ”Y”’, QUERY_SECURITY
=>’Y’);

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
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.

You might also like