20-2 Oracle E-Business Suite Developer's Guide
Accounting Flexfield to include six segments, while another company includes twelve
segments, all without programming.
A key flexfield represents an intelligent key that uniquely identifies an application
entity. Each key flexfield segment has a name you assign, and a set of valid values you
specify. Each value has a meaning you also specify. Oracle General Ledger's Accounting
Flexfield is an example of a key flexfield used to uniquely identify a general ledger
You can use key flexfields in many applications. For example, you could use a Part
Flexfield in an inventory application to uniquely identify parts. Your Part Flexfield
could contain such segments as product class, product code, size, color and packaging
code. You could define valid values for the color segment, for example, to range from 01
to 10, where 01 means red, 02 means blue, and so on. You could even specify
cross-validation rules to describe valid combinations of segment values. For example,
products with a specific product code may only be available in certain colors.
Descriptive flexfields let you satisfy different groups of users without having to
reprogram your application, by letting you provide customizable "expansion space" on
your forms. For example, suppose you have a retail application that keeps track of
customers. Your Customers form would normally include fields such as Name,
Address, State, Customer Number, and so on. However, your form might not include
extra fields to keep track of customer clothing size and color preferences, or regular
salesperson, since these are attributes of the customer entity that depend on how your
users use your application. For example, if your retail application is used for a tool
company, a field for clothing size would be undesirable. Even if you initially provide all
the fields your users need, your users might later identify even more customer
attributes that they want to keep track of. You add a descriptive flexfield to your form
so that your users have the desired expansion space. Your users can also take advantage
of the fact that descriptive flexfields can be context sensitive, where the information
your application stores depends on other values your users enter in other parts of the
A descriptive flexfield describes an application entity, providing form and database
expansion space that you can customize. Each descriptive segment has a name you
assign. You can specify valid segment values or set up criteria to validate the entry of
Oracle General Ledger includes a descriptive flexfield in its journal entry form to allow
end users to add information of their own choosing. For example, end users might want
to capture additional information about each journal entry, such as source document
number or the name of the person who prepared the entry.
You could use a descriptive flexfield in a fixed assets application you build to allow
further description of a fixed asset. You could let the structure of your assets flexfield
depend on the value of an asset type field. For example, if asset type were "desk", your
descriptive flexfield could prompt for style, size and wood type. If asset type were
"computer", your descriptive flexfield could prompt for CPU chip and memory size.
Flexibility is important. There is no way for you to anticipate all the form and database
fields your end users might want, nor how each field should look as end user needs
change. Using key and descriptive flexfields, you give end users the ability to customize
your application to match their business needs, without programming. You should
build a flexfield into your application whenever you need a flexible data structure.
Customizing a flexfield means specifying the prompt, length and data type of each
flexfield segment. It also includes specifying valid values for each segment, and the
meaning of each value to your application. You or your end users can even define
cross-validation rules to specify valid combinations of segment values.
Ordinarily, your end users customize flexfields during application installation.
However, you, as a developer, can customize flexfields while you are developing your
application. Even if end users never change a flexfield once you have customized it,
they can take advantage of useful flexfield features such as automatic segment
validation, automatic segment cross-validation, multiple segment structures, and more.
Multiple Structures for a Single Flexfield
In some applications, different users need different segment structures for the same
flexfield. Or, you might want different segments in a flexfield depending on, for
example, the value of another form or database field.
Flexfields lets you define multiple segment structures for the same flexfield. Your
flexfield can display different prompts and fields for different end users based on a data
condition in your form or application data.
Oracle General Ledger, for example, provides different Accounting Flexfield structures
for users of different sets of books. Oracle General Ledger determines which flexfield
structure to use based on the value of a Set of Books user profile option.
Standard Request Submission Parameters
Most of the features used with your flexfield segments also apply to your parameter
window for Standard Request Submission programs. For example, you can define
security rules and special value sets for your report parameters.
For more explanation of flexfields features and concepts, see the Oracle E-Business Suite
20-4 Oracle E-Business Suite Developer's Guide
For a key flexfield, a segment is a single piece of the complete code. For a descriptive
flexfield, a segment is a single field or a single attribute of the entity. A segment is
represented by a single column in a table.
For a key flexfield, a combination of segment values that make up the complete code or
key. You can define valid combinations with simple cross-validation rules when you
customize your key flexfield. Groups of valid combinations can be expressed as ranges.
A flexfield structure is a particular arrangement of flexfield segments. The maximum
size of the structure depends on the individual flexfield. A flexfield may have one or
more structures. Both key and descriptive flexfields can have more than one structure.
Users can tailor structures for specific needs.
For a key flexfield, a database table you include in your application to store valid
combinations of key flexfield segment values. Each key flexfield must have a
combinations table. It contains columns for each flexfield segment, as well as other
columns. This is the same table you use as your entity table.
For a key flexfield, a combinations form is the form whose base table (or view) is the
combinations table. The only purpose of the combinations form is to maintain the
combinations table. Most key flexfields have one combinations form, although some
key flexfields do not have a combinations form. Key flexfields without combinations
forms are maintained from other forms using dynamic insertion.
Dynamic insertion is the insertion of a new valid combination into a key flexfield
combinations table from a form other than the combinations form.
For key flexfields whose combinations table does not contain any mandatory columns
other than flexfield and WHO columns, you can choose to allow dynamic inserts when
you set up your key flexfield. If you allow dynamic inserts, your user can enter new
combinations of segment values using the flexfield window from a form other than the
combinations form. If your end user enters a new combination that satisfies
cross-validation rules, your flexfield dynamically inserts it into the combinations table.
Otherwise, a message appears and the user is required to correct the segment values
that violate the cross-validation rules.
If you create your key flexfield using a combinations table that contains mandatory
columns other than flexfield or WHO columns, you cannot allow dynamic inserts, and
your end user cannot enter new combinations through the flexfield window from any
form other than the combinations form.
A flexfield qualifier identifies a segment your end user should define when customizing
your key flexfield. By specifying flexfield qualifiers when you build your application,
you ensure your end user customizes your flexfield to include key segments that your
For example, suppose you build a general ledger accounting application that uses a key
flexfield to uniquely identify accounts. Your application requires that one key segment
be an account segment, and one be a balancing segment. You ensure your end user
defines these key segments by defining two flexfield qualifiers, account and balancing.
When customizing your accounting flexfield, your end user ties the account and
balancing flexfield qualifiers to particular key segments. You, as the developer, need not
know which key segment becomes the account or balancing segment, because the key
flexfield takes care of returning account and balancing information to your application
A segment qualifier describes characteristics of key segment values. You use segment
qualifiers to obtain information about segment values your end user enters while using
For example, suppose your end user enters a value in the account segment of a flexfield
that uniquely identifies general ledger accounts. Since you, as the developer, do not
know which segment represents account, your application cannot reference the account
value directly. However, you can construct your application so that each account value
has an associated segment qualifier called "Account type" that your application can
Assume that account value 1000 (which means "Cash") has an account type of "Asset".
Your application can reference this account type because your key flexfield returns it to
a column you designate in your generic combinations table. Your application can
contain logic that is conditional on account type.
You can define segment qualifiers when you define flexfield qualifiers. You can assign
one or more segment qualifiers to each flexfield qualifier.
Structure Defining Column
A column you include in a combinations table or entity table so the flexfield can
support multiple segment structures. You can construct your application so that it
places a value in a structure defining column to determine the flexfield segment
structure your end user sees.
For example, Oracle General Ledger places a "Chart of Accounts" identifier in the
20-6 Oracle E-Business Suite Developer's Guide
structure defining column of the combinations table for the Accounting Flexfield. As a
result, Oracle General Ledger can provide different Accounting Flexfield structures
(different charts of accounts) for different users.
Building a Flexfield into Your Application
To include a flexfield in an application you are building, you perform the following
First, you decide which application entities require key or descriptive flexfields. You
use a key flexfield to uniquely identify an entity that needs an intelligent key.
Important: We provide key flexfield information such as combinations
table structure and form syntax. You may use this information to
integrate your custom forms and applications with key flexfields that
Oracle E-Business Suite provides. For example, you may build foreign
key forms that call Oracle E-Business Suite key flexfields. However, the
API for key flexfields may change in future versions of Oracle
E-Business Suite, so we recommend that you do not create any new key
flexfields that are not provided by Oracle E-Business Suite.
You use a descriptive flexfield to provide context-sensitive expansion space for carrying
additional information about an entity. To maximize your user's flexibility, you should
consider defining a descriptive flexfield for every entity in your application.
After deciding that an application entity requires a flexfield, you design the flexfield
into your applications database. You register the flexfield with Oracle Application
Object Library, and if you like, assign flexfield and segment qualifiers for your key
flexfields. Then, you develop application forms that include your flexfield and call
Oracle Application Object Library routines to activate it.
After you are done defining a flexfield, you or your end user can customize it to include
a specific set of segments.
Designing Flexfields into Your Application Database
You include flexfield columns in the database table that represents the application
entity for which you are defining a flexfield. You include one column for each flexfield
segment you or your end user might wish to customize. You need at least as many
columns as the maximum number of segments a user would ever want in a single
flexfield structure. If you have more segments than can fit on your screen when the
flexfield window is open, you can scroll through them vertically.
For a key flexfield, a combinations table represents the application entity. A
combinations table includes flexfield segment columns as well as other columns a key
flexfield requires. Key flexfields provided by Oracle E-Business Suite already have
combinations tables defined.
To permit the use of flexfield combinations from different application forms, you must
include foreign key references to your combination table's unique ID column in other
application tables. That way, you can display or enter valid combinations using forms
not based on your combinations table. When you build a custom application that uses
Oracle E-Business Suite key flexfields, you would include foreign key references in your
custom application tables wherever you reference the flexfield.
To define a descriptive flexfield, you include descriptive segment columns in the
application table you choose. You also include a structure defining column (sometimes
called a context column), in case your end user wants to define multiple segment
Registering a Flexfield
You register a flexfield with Oracle Application Object Library after you design it into
your database. By registering a flexfield, you notify Object Library that your flexfield
exists in the database, and provide some basic information about it.
When you register a flexfield, you give it a name that end users see when they open
your flexfield pop-up window (for example, "Accounting Flexfield" or "Vendor
Flexfield"). End users can change the flexfield name you provide when they customize
Building a Flexfield into a Form
To add a flexfield to a form, you define hidden form fields to represent the flexfield
columns you defined in your application table (that is, unique ID, structure defining,
segment, and other columns). You also define a visible form field to hold the
concatenated segment value string that appears on your form after your end user enters
segment values. You can optionally include a visible form field to hold a concatenated
string of the meanings of each segment.
To activate your flexfield, you call Oracle Application Object Library routines from your
Flexfields and Application Upgrades
Application upgrades do not affect the flexfields you have defined or customized.
However, you may have to recompile your flexfields for some application upgrades.
You recompile your key flexfields using the Key Flexfield Segments form, and you use
the Descriptive Flexfield Segments form to recompile descriptive flexfields. Simply
scroll through and save each row that defines your flexfield, and the form automatically
recompiles your flexfield.
20-8 Oracle E-Business Suite Developer's Guide
You can also recompile all of your frozen flexfields in one step from the operating
system. See your installation manual for more information about compiling all your
flexfields in one step after an application upgrade.
Oracle E-Business Suite Flexfields Guide
Implementing Key Flexfields
To implement a key flexfield you must:
Define key flexfield columns in your database
Register your table with Oracle Application Object Library
Register your key flexfield with Oracle Application Object Library
Create key flexfield fields in your forms
Add key flexfield routines to your forms
Key flexfields can be implemented for the following three types of forms, which are
each implemented differently:
Combinations form - The only purpose of a combinations form is to create and
maintain code combinations. The combinations table (or a view of it) is the base
table of this form and contains all the key flexfield segment columns. The
combinations table also contains a unique ID column. This type of form is also
known as a maintenance form for code combinations. You would have only one
combinations form for a given key flexfield (though you might not have one at all).
You cannot implement shorthand flexfield entry for a combinations form.
Form with foreign key reference - The base table (or view) of the form contains a
foreign key reference to a combinations table that contains the actual flexfield
segment columns. You create a form with a foreign key reference if you want to use
your form to manipulate rows containing combination IDs. The primary purpose of
foreign key forms is generally unrelated to the fact that some fields may be key
flexfields. That is, the purpose of the form is to do whatever business function is
required (such as entering orders, receiving parts, and so on). You might have
many foreign key forms that use a given key flexfield. You can choose to implement
shorthand flexfield entry only for a form with a foreign key reference.
Form with key flexfield range - The base table is a special "combinations table" that
contains two columns for each key flexfield segment so it can support both low and
high values for each segment of your key flexfield. This type of form is rare.
Documents you may be interested
Documents you may be interested