Oracle 11i – Extending the power of flexfields
Oracle 11i – Extending the power of flexfields
A white paper on extending descriptive flexfields
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 1
Oracle 11i – Extending the power of flexfields
Table of Contents
Oracle 11i – Extending the power of flexfields.............................................................................................................. 1
Table of Contents ............................................................................................................................................................... 2
Overview.............................................................................................................................................................................. 3
Features ................................................................................................................................................................................ 3
Architecture ......................................................................................................................................................................... 5
Setups ................................................................................................................................................................................... 8
Standard Oracle DFF Setup.......................................................................................................................................... 8
Extended Flexfield (xDFF) Setups ............................................................................................................................ 10
Utilities................................................................................................................................................................................ 12
Limitations ......................................................................................................................................................................... 13
Appendix 1 : ERD and Table Definitions..................................................................................................................... 14
Appendix 2 : Custom.pll code......................................................................................................................................... 15
Appendix 3 : Utilities........................................................................................................................................................ 16
Parameter.............................................................................................................................................................. 16
IN/OUT............................................................................................................................................................... 16
Parameter.............................................................................................................................................................. 16
IN/OUT............................................................................................................................................................... 16
About the Author ............................................................................................................................................................. 17
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 2
Oracle 11i – Extending the power of flexfields
Overview
Descriptive Flexfields1 (DFFs) have always been an extremely popular Oracle Apps feature, but like
all good things there are only so many of them. As a result the DFFs are often treated as valuable
real-estate and a lot of clients invariably run out of them. This happens especially in case of objects
like Sales Order Header, Lines and Items. Running out of flexfields often leads to compromises on
extensions/customizations and/or information that can be stored/readily accessed for business.
This white paper outlines a solution, that lets one add almost an unlimited number of flexfields to
any number of objects. This solution
Features
The extended DFF (xDFF) solution is a means by which a user can add additional reference data to
any form in Oracle Applications through some basic setups. The tool uses Oracle Application’s
flexfield and ZOOM features to enable this functionality.
• This is a simple solution and is very easy to develop and implement. With our documentation
most people are able to implement it in a day or two.
• Extended Flexfields is a completely non-invasive extension.
• It needs minimal setups to be enabled for any new object. Adding a new object is almost as
easy as adding a new context to a standard Oracle flexfield.
• It uses standard Oracle DFFs and hence utilizes the same forms and fields to exploit all of
the standard Oracle DFF features like
o Ease of setup
o Defaulting
o Value-sets
o customized prompts and
o display sizes.
1 Descriptive flexfields provide customizable ”expansion space” on your forms. You can use descriptive
flexfields to track additional information, important and unique to your business, that would not otherwise be
captured by the form.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 3
Oracle 11i – Extending the power of flexfields
• xDFFs defined for one object can be accessed by almost any other related objects using
minimal setups2. For example, you could access the xDFFs entered for Sales Order Line
from corresponding Invoice line directly or you could access the xDFFs entered for an RMA
from the Receipt form.
2 This behavior is very similar to the behavior of standard oracle attachments, with lesser flexibility though.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 4
Oracle 11i – Extending the power of flexfields
Architecture
The extended DFF solution uses Oracle’s DFF and ZOOM architecture.
The solution comprises of the following components
• xDFF setup tables. These tables store
o Name the form where xDFF is to be enabled.
o The flexfield segment to be used for it.
o The form block and field names where the primary keys for the underlying object
are stored.
o The names of other forms and zones from where this xDFF can be accessed and
the field names where the primary keys for the underlying object are stored.
• A form to maintain the above table.
• A xDFF table that stores the object name, Primary Keys and extended flexfiled values for all
the objects.
• Code to be incorporated in custom.pll.
• Standard Oracle Flexfield Setups.
o Registering the columns of ‘xDFF attributes’ table as descriptive flexfield segments.
o Registering the ‘Extended Flexfield’ Title.
o Defining DFF segments.
Enabling at least one flexfield context per object where xDFF has to be enabled.
For the purpose of this paper we will take a case where we have to enable xDFF for Items form. The
following diagram explains how the overall architecture works.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 5
Oracle 11i – Extending the power of flexfields
xDFF architecture - Calling xDFF form from Application
Custom.pll checks the
xDFF setup table to enable
the zoom only when extended
flexfields are enabled for the form/zone.
Custom.pll is used to call
the xDFF form via ZOOM and
to pass appropriate values to the
xDFF form.
xDFF Setup (see xDFF setup diagram
Table
Item Form
Context Field contains the list of xDFFs that can
be viewed from this form/zone.
DFF segments are the
only visible fields
on xDFF form.
(see DFF setup diagram
for more details)
All extended flex field values
along with primary key values and
context
are stored in the xDFF table.
xDFF Table
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 6
Oracle 11i – Extending the power of flexfields
Whenever a user opens a form (Item Master form in our example), the custom.pll checks the xDFF
setup table to see if xDFF is enabled for the form/zone or not. If it is, the zoom is enabled for the
form.
When user invokes zoom, the zoom event in the custom.pll selects the object name, primary keys
and the flexfield context on the basis of form/block name and passes the information to the xDFF
form, where it is stored in the appropriate fields parameter block. The context defaults from the
parameter block. The list of value for the context contains a list of all the xDFF segments that can be
viewed from the Items form. When the user clicks on the flexfield, the enabled xDFF segments for
the context pop up.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 7
Oracle 11i – Extending the power of flexfields
Setups
Standard Oracle DFF Setup
In order to use this tool the users will have to configure a context sensitive flexfield and associate
their flexfield configuration (CONTEXT) to the form. This association is done through a
maintenance form (ZOOM Maintenance) that is a part of the System Administration Responsibility.
Once the setups/configurations are done, the additional reference fields are available through a
ZOOM.The following basic setup needs to be done, before any specfic setups for any form can be
done.
1. The attribute columns for the xDFF table have to be registered as DFF segments.
2. The DFF segments have to be defined.
For our example, we need to create a new context, say ITEM, and then enable as many segments for
it as we need to.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 8
Oracle 11i – Extending the power of flexfields
xDFF architecture - DFF setup
Std. DFF Setup Form
Context used in
xDFF setup.
Std. DFF Segments
Form
xDFF Form
DFF segments are
visible fields on xDFF form.
DFF context is defaulted,
causing only the appropriate
segments to appear.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 9
Oracle 11i – Extending the power of flexfields
Extended Flexfield (xDFF) Setups
The form name and block name where xDFF has to be enabled should be associated with the
appropriate context defined in the DFF setups and to the correct PK fields.
For our example we need to create one record for Form INVIDTM and block
MTL_SYSTEM_ITEMS. The context here would be ‘ITEM’ as defined in the DFF setup earlier.
The primary keys for the item object are inventory_item_id and organization_id that, incidentally, are
stored in the fields of the same name in the MTL_SYSTEM_ITEMS block of INVIDTM block. So
we will use inventory_item_id and organization_id for key column 1 and key column 2 respectively.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 10
Oracle 11i – Extending the power of flexfields
xDFF architecture - xDFF setup
Same as the context
defined in DFF setup
Custom.pll is used to call
the xDFF form via ZOOM and
to pass appropriate values. The
Attribute Context and primary key values
are selected on the basis of the
calling form and block name
and passed to the xDFF form.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 11
Oracle 11i – Extending the power of flexfields
Utilities
The following utilities enhance the ease of use for the xDFF solution.
• This set of PL/SQL utilities package contains functions to select, update and insert xDFF records.
Even though the extended flexfield tables can be accessed directly, this utility make it much easier for
the programmers developing forms/reports/customized programs to manipulate xDFFs.
• Purge utility deletes un-referenced extended flexfield records.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 12
Oracle 11i – Extending the power of flexfields
Limitations
The extended flexfields have all the features of the standard oracle flexfields except for the following limitation:
1. Since the extended DFF form is a zoom form, the ‘Required Field’ functionality cannot be enforced.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 13
Oracle 11i – Extending the power of flexfields
Appendix 1 : ERD and Table Definitions
Send an email to [email protected] for more information on this section.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 14
Oracle 11i – Extending the power of flexfields
Appendix 2 : Custom.pll code
Send an email to [email protected] for more information on this section.
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 15
Oracle 11i – Extending the power of flexfields
Appendix 3 : Utilities
The following functions/procedures that can be used to get or set xDFF values in any
customization/interfaces or report. The pl/sql code package with these functions is attached at the end.
purge_unrefrenced_flexs
Parameter IN/OUT Type Default Comments
px_object_name IN VARCHAR2 Name of the object
(MTL_SYSTEM_ITEMS in our case)
extended_flex_values
get
put
Parameter IN/OUT Type Default Comments
px_object_name IN VARCHAR2 Name of the object
(MTL_SYSTEM_ITEMS in our case)
px_data OUT xxxx_xDFF %ROWTYPE Returns the entire record.
px_pk1 IN VARCHAR2
px_pk2 IN VARCHAR2 NULL
px_pk3 IN VARCHAR2 NULL
px_pk4 IN VARCHAR2 NULL
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 16
Oracle 11i – Extending the power of flexfields
About the Author
Neocortex, Inc.
This document contains information that is proprietary to Neocortex, Inc. Do not
reproduce or reuse this information without express written consent of Neocortex, Inc.
Significant contributions were made to this idea by Kenny Kesar of Oracle Corporation and
Suresh Vaidyanathan of Agilent Technologies. Infact the two of them helped implement a
solution based on this concept at a fortune 500 company.
Pankaj Jain, is a founding partner of Neocortex. He has worked as an Oracle Applications
consultant for more than 9 years now. He is an IIM, Ahmedabad alumnus. Please send any
comments/remarks on this paper to him at
[email protected]. We will love to find out
if this document was useful to you, please let us know. If you want to implement this
solution at your organization, please let us know, we can send you all the code we developed
for prototyping this solution.
Neocortex, Inc.
39275, State Street,
Fremont, CA 94538
www.neocortex.com
[email protected]
510-435-8536
NeoCortex, Inc., 839, West Sunset Bvld, Hayward, CA 94541
Phone: 510 435 8536 Fax: 801 365 7553 www.neocortex.com
Neocortex, Inc. Page 17