Descriptive Flex Fields (DFF) in OeBS R12

**Descriptive Flex Fields (DFF)** are a tool in the Oracle E-Business Suite (OeBS) environment for universalizing the use of the same table fields to store properties of different entities. Typically, this is a set of fields such as `ATTRIBUTE1..ATTRIBUTE15` (`varchar2(150)`) for storing properties and the `ATTRIBUTE_CATEGORY` field for storing the context. Depending on the context, the same field can have different business meanings.

Let’s implement the following example. We have a table of vehicles. We will create a descriptive flexfield with two contexts: passenger cars (`CARS`) and trucks (`TRUCKS`). Depending on the context, we will populate the attributes with the following data:
In different contexts, a varying number of attributes can be used. In our example, ATTRIBUTE3 is not utilized in the CARScontext.
Let’s get started.
1) Create a table and a view (the view will be useful in the next step).
create table xxmy.car_flex_test(
       id                      number not null,
       name                    varchar2(50),
       car_number              varchar2(9),
       attribute_category      varchar2(30),
       attribute1              varchar2(150),
       attribute2              varchar2(150),
       attribute3              varchar2(150),
       attribute4              varchar2(150),
       attribute5              varchar2(150),
       attribute6              varchar2(150),
       attribute7              varchar2(150),
       attribute8              varchar2(150),
       attribute9              varchar2(150),
       attribute10             varchar2(150),
       attribute11             varchar2(150),
       attribute12             varchar2(150),
       attribute13             varchar2(150),
       attribute14             varchar2(150),
       attribute15             varchar2(150),
       created_by              number not null,
       creation_date           date   not null,
       last_updated_by         number not null,
       last_update_date        date   not null,
       last_update_login       number not null,
       object_version_number   number not null)
/
create or replace view car_flex_test_dfv as
select rowid row_id,
       fts.attribute_category,
       fts.attribute1,
       fts.attribute2,
       fts.attribute3,
       fts.attribute1 || '.' || fts.attribute2 || '.' ||
       fts.attribute3 concatenated_segments
       from xxmy.car_flex_test fts; 
In order to create a Descriptive Flexfield (DFF) on a table, the table must first be registered:
 declare
 l_table_id number;
 p_table_name varchar2(30) := 'CAR_FLEX_TEST';
    cursor c_data is
      select column_name,
             column_id,
             data_type,
             data_length,
             nullable,
             'N' translatable
        from all_tab_columns
       where owner = 'XXMY'
         and upper(table_name) = p_table_name
       order by column_id;
  BEGIN
    —check for registration
    begin
     select table_id
      into l_table_id
      from fnd_tables ft, fnd_application fa
     where fa.application_short_name = 'XXMY'
       and ft.application_id = fa.application_id
       and upper(ft.table_name) = p_table_name;
    exception 
      when NO_DATA_FOUND then
        l_table_id := null;
    end;   

    if l_table_id is not null then
      return;
    end if;
    —register the table
    ad_dd.register_table(p_appl_short_name => 'XXMY',
                         p_tab_name        => p_table_name,
                         p_tab_type        => 'T');
    —register columns
    for v_data in c_data loop
      ad_dd.register_column(p_appl_short_name => 'XXMY',
                            p_tab_name        => p_table_name,
                            p_col_name        => v_data.column_name,
                            p_col_seq         => v_data.column_id,
                            p_col_type        => v_data.data_type,
                            p_col_width       => v_data.data_length,
                            p_nullable        => v_data.nullable,
                            p_translate       => v_data.translatable);
    end loop;
  commit;
end;
Backup script:
declare
    p_table_name varchar2(30) := 'CAR_FLEX_TEST';
begin
    ad_dd.delete_table(p_appl_short_name => 'XXMY',
                       p_tab_name        => p_table_name);
end;
The delimiters in the view must match those used in the future Descriptive Flexfield (DFF). In this case, it is a dot (.).
2) Create the Descriptive Flexfield.
CAR_FLEX_TEST_DFV is the name of our view
Data set for column TYPE cars
Data set for column TYPE trucks
We've got two contexts
Context Segments for CARS :
FLEX_TEST_CAR_VS - a set of values based on the value set FLEX_TEST_CAR.
Context Segments for TUCKS
To use the created Descriptive Flexfield (DFF), it must be "frozen." Otherwise, you will encounter the error: "The descriptive flexfield with application name is not frozen."
3) Embedding the Created Descriptive Flexfield (DFF) into a Page
To achieve this, we will create a search page (DFTestPG) with "Search" and "Create" buttons, and a record editing page (DFTestCreatePG). The server package contains an Entity Object (EO) based on the table we created and a View Object (VO) based on the EO. For editing a record, one of the fields will be made reference-based. The embedded flexbean on the DFTestCreatePG page will look like this:
No further steps are required. The property Display Context Field = true specifies that a separate context switcher will be displayed for selecting the context. If the Segment List property is not defined, all segments available in the context will be loaded by default. To manually set this property based on the passed context, you can use the following code:
with segments as(
select rownum rn, fcu.form_above_prompt segname
       from FND_DESCRIPTIVE_FLEXS dfx,
            FND_DESCR_FLEX_CONTEXTS dfc,
            FND_DESCR_FLEX_COL_USAGE_TL fcu
       where dfx.descriptive_flexfield_name = 'CAR_FLEX_TEST'
       and   dfx.application_table_name = dfc.descriptive_flexfield_name
       and   fcu.descriptive_flexfield_name = dfx.descriptive_flexfield_name
       and   fcu.descriptive_flex_context_code = dfc.descriptive_flex_context_code
       and   fcu.source_lang = 'RU'
       and   fcu.language = 'RU'
       and   dfc.descriptive_flex_context_code = 'CARS'
) select substr(sys_connect_by_path(segname, '|'), 2)
         from segments
      where connect_by_isleaf = 1
      connect by prior rn = rn - 1
      start with rn = 1
The result will be a string of segments separated by the | delimiter, as per the OAF (Oracle Applications Framework) convention.
All segments, along with their descriptions and value sets, are loaded automatically.
One
Two
OK.
ceo@thomsonslegacy.com

We customize Oracle e-Business Suite R12 modules with Oracle Applications Framework and providing Oracle ADF based solutions


© Thomsonslegacy.com, 2025.
If you publish the materials of the site, the reference to the source is obligatory. The site uses cookies.