Breadcrumb

Felxfields Sample

Flexfield definition

You can modify dinamically flexfield definition below, changes will be reflected at items on previous region:

(null)(null)
FLEXFIELD_DEMOFLEXFIELD_001
FLEXFIELD_DEMOFLEXFIELD_002
FLEXFIELD_DEMOFLEXFIELD_003
FLEXFIELD_DEMOFLEXFIELD_004

Help

Download this page export


Go to GitHub


Flexfield

 

The aim of this plugin is to provide dynamic item types which will be loaded at plugin runtime. For people who worked with Oracle eBusinessSuite I developed a similar idea which could fit perfectly with their own EBS flexfields.

 

Requisites to use:

·         An existing data base table with N flexfield fields of varchar2(4000) to fill

·         Optional: flexfield metadata table (FLEXFIELD_DEF, see example below)

·         This plugin on some page

 

 

Case of use

Some applications leave administrators the capability of extending its application by adding some fields to existing tables. In that case, administrator can expand application functionality by storing some data to application without the need of technical assistance.

 

Imagine you have your business table of products

 

PRODUCTS

 

You can define N flexfield items which application administrator will define:

 

PRODUCTS:

            FLEXFIELD_001 (varchar2(4000))

            FLEXFIELD_002 (varchar2(4000))

            ...

            FLEXFIELD_NNN (varchar2(4000))

 

Then you need a parametrization table for flexfield metadata, for instance:

 

FLEXFIELD_DEF:

 

Then you define a page which uses this plugin by querying previous table. SQL of flexfield plugin:

 

SELECT FLEX_NAME

                FLEX_DESCR,

                FLEX_TYPE,

                FLEX_SOURCE,

                ‘N’ FLEX_NULLABLE,

                          30 FLEX_SIZE

                null FLEX_MAX_SIZE,

                null FLEX_HEIGHT,

                ‘’ FLEX_HTML_ATTRIBUTES

                ‘’ LOV_SQL

FROM FLEXFIELD_DEF

WHERE FLEX_NAME = ‘MyFlex01’ and ACTIVE = ‘S’

 

Some tricks:

·         You can dynamically display item label by caching its value via ITEM. For instance, define item plugin label as &P1_ITEM. And inform item value at page value, by reading FLEXFIELD_DEF table.

·         Like previous sample, you can dynamically define its column name for a report using previous item &P1_ITEM.

·         You can lookup display value for report listing using FLEXFIELD.lookup_display_value(table,column,lov_return_value)

·         If you keep a naming convention for application items like <PREFIX>_TABLE_<FLEX_NUMBER> you can call procedure:  FLEXFIELD.intialize_application_items which will set each application time with its value

 

 

Available item types:

·         STRING: Textfield

·         TEXTAREA: TextArea

·         LOV: Select list (via APEX Lov)

o   Static

o   Dynamic

·         LOVSQL: LOV based on user SQL

o   LOVSQL column must be informed with inner sql

 

Select

       FLEX_NAME,        --(varchar2) Flexfield name

       FLEX_DESC,        --(varchar2) Flexfield description -> Shown at help

       FLEX_TYPE,        --(varchar2) STRING, LOV, LOVSQL, TEXTAREA -> Type of flexfield

       FLEX_LOV,         --(varchar2) Name of APEX LOV for LOV type flexfields

       FLEX_NULLABLE,    --(char(1))  S, N -> Specifies if allows null values

       FLEX_SIZE,        --(Integer)  Size of the HTML element

       FLEX_MAX_LENGTH,  --(Integer)  Max length of its content (only for STRING and TEXTAREA types)

       FLEX_HEIGHT,      --(Integer)  Height of HTML element (only for TEXTAREA)

       FLEX_HTML_ATTR,   --(varchar2) Additional HTML element attributes

       FLEX_LOV_SQL      --(varchar2) In case TYPE= LOVSQL this column specifies LOV SQL returning pairs display value and return value

from FLEXFIELD_DEF

where flexfield_name = 'MyField01'

Comments

 
  • Mohamed · 12-APR-25
    i want to buy you any thing except beer it is not allowed in eslam at all thanks :)    
  • aa · 12-FEB-25
    how to use it ?    
  • Ashutosh · 22-DEC-24
    Hi Josep, Is it possible to have popup lov also with these flex fields?    
  • oo · 12-APR-24
    ooooooooooo    
  • josep · 09-JAN-24
    Hi Rajesh and others, I've added a download link for this page export file at "help" section, hope it helps!    
  • Rajesh · 09-JAN-24
    H Josep, can you please share the page export of above sample page to rajeshkondalablr@gmail.com. I tried installing your plugin and using it in my page item, but not successful so far. Thanks in advance    
  • ApexLearner · 09-JAN-24  
    Can someone please share the tutorial link for Flexfield plugin. Tutorial link seems to be broken    
  • josep · 28-SEP-23
    Hi, I fixed the download error, now you should be able to download the plugin    
  • Marius · 27-SEP-23
    Hi Josep, Would you please send me the page export file at marius.ion.ext@veolia.com? Thank you in advance, Mariud    
  • josep · 23-NOV-21
    Hi Mo, I've regenerated export file in version 21.2 and uploaded it as version 1.1 of this plugin. I see there's an issue with download section, so you can try to download it from this url: https://apex.oracle.com/pls/apex/josepcoves/r/52892/files/static/v15/RELATIONAL_FLEXFIELD_v1.1.sql    
  • Mo · 23-NOV-21
    Hi We have a upgraded version of APEX where this Flexfield plugin is used. In the old version 18 it works but in V21.1.5 it seems to have broken. The plugin was already in version 18 when the whole app was upgraded to V21. Also tried importing the plugin into a V21 test app to debug, but was unsuccessful in importing the plugin with error "Zip archive not valid, no installation manifest file found." Please offer some advice on how to resolve this issue as the plugin is already being used in the upgraded V21. Thanx in advance     
  • Test · 14-SEP-21
    Naren    
  • its me · 13-JUL-21
    Hi there    
  • sift · 20-FEB-18
    shift shift    
  • Jack · 08-FEB-18  
    jack@smitsolutions.nl I also send you an inmail at linkedin.    

Plugin Info

Plugin: Flexfield
Average Rate: 4.23
Visits: 27996
Downloads: 470
Last updated: 23-nov-2021
GitHub:

Donate

If that's useful, why don't you...