APEX Relational Flexfield plugin – Tutorial

In this post I’ll guide you on how to use “flexfield” APEX plugin. For a online demo, you can access:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Let’s assume we want to provide admin users the ability to fill some table fields with their own specification. We assume you have your own demo “EMP” table with employee information.
1. First of all, we need to create a flexfield column on that table, so we call it FLEXFIELD_001. I recommend type VARCHAR2(4000) so that it can be flexible enough:

2. (Optional) Then we’ll define a configuration table for your flexfield so that you can dinamically change its definition. Our configuration table will be:

And we’ll populate that info for a standard TextField:

3. Now you can create a standard APEX “form” for that table (including this new column)

2015-11-16_13h49_30

 

2015-11-16_13h51_43

4. Then you have to change Flexfield Type to “Relational: Flexfield [Plug-In]”

2015-11-16_13h53_04

5. And you need to provide source info from FLEXFIELD_DEF we created at step 2, for List of Values – SQL Query:

 

2015-11-16_14h38_01

2015-11-16_14h36_54

6. If we run the page we’ll see something like:

 

2015-11-16_14h38_50

With your flexfield of type STRING.

7. We may now want to display flexfield name instead of “Flexfield 001”, so that user reads your flexfield name defined at FLEXFIELD_DEF table. For this matter, we can create an item P6_FLEX_001:

2015-11-16_14h43_09

And then we simply replace P6_FLEXFIELD_001 label with &P6_FLEX_001_NAME.:

2015-11-16_14h44_48

 

So, we finally get:

2015-11-16_14h45_02

8. Let’s play a little bit more, to see its possibilites. So imagine we want to change flexfield type, so that it shows a “select list” from a custom query. Imagine you have your SQL query like that:

After that update, you’ll get:
2015-11-16_14h52_31

 

In this case, we used a custom SQL, but you can reuse any of your LOVs definded under “Shared Components”. In this case, you simply have to change “TYPE” = “LOV” and LOV = ‘<LOV_NAME>’ where <LOV_NAME> is the name of your lov under “Shared Components”.  It supports both Dynamic and Static LOVs. You can also define if you want to display null option or not.

8. Finally I’ll show how some more options. Imagine we want a custom TextArea with 5 rows and 30 columns, maximum text length of 240 chars and gray background. In that case you can perform following update:

And you’ll get:

2015-11-16_14h59_14

Well I hope this gives you enough information to know how you can use this plugin. For additional info you can visit:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Enjoy!

Tags: ,

No comments yet.

Leave a Reply

APEX Relational Flexfield plugin – Tutorial

In this post I’ll guide you on how to use “flexfield” APEX plugin. For a online demo, you can access:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Let’s assume we want to provide admin users the ability to fill some table fields with their own specification. We assume you have your own demo “EMP” table with employee information.
1. First of all, we need to create a flexfield column on that table, so we call it FLEXFIELD_001. I recommend type VARCHAR2(4000) so that it can be flexible enough:

2. (Optional) Then we’ll define a configuration table for your flexfield so that you can dinamically change its definition. Our configuration table will be:

And we’ll populate that info for a standard TextField:

3. Now you can create a standard APEX “form” for that table (including this new column)

2015-11-16_13h49_30

 

2015-11-16_13h51_43

4. Then you have to change Flexfield Type to “Relational: Flexfield [Plug-In]”

2015-11-16_13h53_04

5. And you need to provide source info from FLEXFIELD_DEF we created at step 2, for List of Values – SQL Query:

 

2015-11-16_14h38_01

2015-11-16_14h36_54

6. If we run the page we’ll see something like:

 

2015-11-16_14h38_50

With your flexfield of type STRING.

7. We may now want to display flexfield name instead of “Flexfield 001”, so that user reads your flexfield name defined at FLEXFIELD_DEF table. For this matter, we can create an item P6_FLEX_001:

2015-11-16_14h43_09

And then we simply replace P6_FLEXFIELD_001 label with &P6_FLEX_001_NAME.:

2015-11-16_14h44_48

 

So, we finally get:

2015-11-16_14h45_02

8. Let’s play a little bit more, to see its possibilites. So imagine we want to change flexfield type, so that it shows a “select list” from a custom query. Imagine you have your SQL query like that:

After that update, you’ll get:
2015-11-16_14h52_31

 

In this case, we used a custom SQL, but you can reuse any of your LOVs definded under “Shared Components”. In this case, you simply have to change “TYPE” = “LOV” and LOV = ‘<LOV_NAME>’ where <LOV_NAME> is the name of your lov under “Shared Components”.  It supports both Dynamic and Static LOVs. You can also define if you want to display null option or not.

8. Finally I’ll show how some more options. Imagine we want a custom TextArea with 5 rows and 30 columns, maximum text length of 240 chars and gray background. In that case you can perform following update:

And you’ll get:

2015-11-16_14h59_14

Well I hope this gives you enough information to know how you can use this plugin. For additional info you can visit:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Enjoy!

No comments yet.

Leave a Reply

APEX Relational Flexfield plugin – Tutorial

In this post I’ll guide you on how to use “flexfield” APEX plugin. For a online demo, you can access:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Let’s assume we want to provide admin users the ability to fill some table fields with their own specification. We assume you have your own demo “EMP” table with employee information.
1. First of all, we need to create a flexfield column on that table, so we call it FLEXFIELD_001. I recommend type VARCHAR2(4000) so that it can be flexible enough:

2. (Optional) Then we’ll define a configuration table for your flexfield so that you can dinamically change its definition. Our configuration table will be:

And we’ll populate that info for a standard TextField:

3. Now you can create a standard APEX “form” for that table (including this new column)

2015-11-16_13h49_30

 

2015-11-16_13h51_43

4. Then you have to change Flexfield Type to “Relational: Flexfield [Plug-In]”

2015-11-16_13h53_04

5. And you need to provide source info from FLEXFIELD_DEF we created at step 2, for List of Values – SQL Query:

 

2015-11-16_14h38_01

2015-11-16_14h36_54

6. If we run the page we’ll see something like:

 

2015-11-16_14h38_50

With your flexfield of type STRING.

7. We may now want to display flexfield name instead of “Flexfield 001”, so that user reads your flexfield name defined at FLEXFIELD_DEF table. For this matter, we can create an item P6_FLEX_001:

2015-11-16_14h43_09

And then we simply replace P6_FLEXFIELD_001 label with &P6_FLEX_001_NAME.:

2015-11-16_14h44_48

 

So, we finally get:

2015-11-16_14h45_02

8. Let’s play a little bit more, to see its possibilites. So imagine we want to change flexfield type, so that it shows a “select list” from a custom query. Imagine you have your SQL query like that:

After that update, you’ll get:
2015-11-16_14h52_31

 

In this case, we used a custom SQL, but you can reuse any of your LOVs definded under “Shared Components”. In this case, you simply have to change “TYPE” = “LOV” and LOV = ‘<LOV_NAME>’ where <LOV_NAME> is the name of your lov under “Shared Components”.  It supports both Dynamic and Static LOVs. You can also define if you want to display null option or not.

8. Finally I’ll show how some more options. Imagine we want a custom TextArea with 5 rows and 30 columns, maximum text length of 240 chars and gray background. In that case you can perform following update:

And you’ll get:

2015-11-16_14h59_14

Well I hope this gives you enough information to know how you can use this plugin. For additional info you can visit:

https://apex.oracle.com/pls/apex/f?p=JOSEPCOVES:FLEXFIELDS

Enjoy!

Tags: , , , ,

2 Responses to “APEX Relational Flexfield plugin – Tutorial”

  1. Salim 18/11/2015 at 06:24 #

    There is an error in the demo:

    Error in PLSQL code raised during plug-in processing.

    ORA-06503: PL/SQL: Function returned without value

  2. josepcoves 18/11/2015 at 07:24 #

    Thanks Salim. It’s working again.

Leave a Reply