Infolinks

Wednesday, 4 July 2012

Descriptive Flexfields

 Descriptive Flexfields
In this article, I would like to explain some tricks with context sensitive Descriptive Flexfields. To begin with lets consider some scenarios as below.

Scenario 1
. Depending upon the responsibility user has logged into, you wish to either show two flexfield segemts or three segments. This is a fairly common requirement.
Scenario 2. There are two different oracle screens, both based on same table but different functionality. Hence the share the same descriptiveflexfields. You wish to use notation :block.fieldname in the value set. But this will work in one screen and error in another.


Can't we simply use context sensitive flexfields?
You certainly can. However, what if you do not want to make your user select the value in context field manually? In this case you need to take your design a step further.
In fact, before you proceed further with this article, you must read this link Basic Concepts of Context Sensitive Descriptive Flexfields.
In case you do not know much about profile options, you must also read link basic concepts of Profile Options


What are the options at hand for solutions to Scenatio 1 and Scenario 2?
Option 1. Use profile option as the context
Option 2. Use a system global variable as the context.


How does this work?
In case of using profile option, value in Context Reference Field of the descriptive flexfield will be the profile option[see picture below].
Lets say for Responsibility-1 this profile is set to XX, and for Responsibility-2 this profile is set to YY, and for a special user this profile is set to value ZZ.

You can then define three different contexts, as below.
Context XX
  Uses attribute1 and attribute2, using value sets vs1 and vs2
Context YY
  Uses attribute 1, using value set vs3
Context ZZ
  Uses attribute2 with value set vs4 , making this descriptive flexfield segment mandatory.

Depending upon which responsibility user logs into, and also depending upon which user logs into the screen, they will see different flexfield segments popping up.



Ah, what if same user in a single responsibility has access to different screens that share same DFF?

In this scenario, you can design your descriptive flexfield on a System variable context. Hence your context will be :SYSTEM.CURRENT_FORM. Depending upon which form the user has navigated to, they will see different segments.

Note: Use Examine utility to find out the Current Form Name


Sounds good, but what are the pitfalls?
1. :blockname.fieldname convention does not works for OA Framework screens.
2. There is only one context reference field available per Descriptive Flexfield. If you choose to have your DFF context sensitive on a profile option, then you will have to live with it forever(ah should I say fusion-when D2K forms are gone). However this limitation can be overcome by using fnd_profile.put api, to alter the profile option value at runtime for forms session. Effectively you can modify the context[by changing profile option value pragmatically], using formspersonalizations.


How about OA Framework? Do we need these design methodology in OA Framework too?
Not really, because in OA Framework, you can use personalizations to decide which Context + Attribute combination must be displayed. Personalizations can be performed at responsibility level to get the desired result as discussed in example above.

=================

An article on Context Sensitive Descriptive Flexfields, for beginners that follow http://getappstraining.blogspot.com



A training article on Context Sensitive Descriptive flexfields.
IMPORTANT:- You must read Basics Flexfield article . This article is an extension to the work that we did for a simple flexfields. 

First some basic Question and answers, and then we will do screenshots detailing how flexfields are configured.


Question: I want these Flex fields to appear in screen only when certain conditions are met. Is it possible?
Answer: Yes, you can. Lets take an Example. You have a "Bank Branch" screen where you enter the Bank names and their branches . There is a field named Branch Type in that screen. You wish to show & capture following new fields:-
a.    Banks Country of Origin Field ( regardless of bank branch type, we must show this new field). As we configured in earlier training chapter.
b.    If user entered a value of SWIFT in Branch type, then display a new DFF segment "SWIFT Partner field".
c.    If Branch type CHIPS is selected by the user, then display a DFF segment "Chip ID" field.


In Order to do this, we will follow the below steps(screenshots will follow) :-
1.    Navigate to the DFF Registration screen in Oracle Apps and query on Table AP_BANK_BRANCES. Now click on Reference Field, and ensure that “BANK_BRANCH_TYPE” field can be used as a context switch. In our case we add this field as a reference field.
2.    Navigate to DFF Segments screen and query on the Title of the “Bank Branch” and Unfreeze the Flexfield and add segments as in screenshot below. Register the BANK_BRANCH_TYPE field as a reference item.
3. Create the contexts for each possible value of Bank Branch Type field(for which you want conditional display of fields)....
Hmmmm not clear yet, see the the screenshots and you will surely understand......

Find out the table name for Bank Branch screen, this will enable us to find the DFF that is available for Bank Branch Image
The Bank Branch can have one of the following values.
Image
Given that our DFF will be sensitive to what we enter in Bank Branch, we must find out name of the field(not the display name). This can be done by using examine as shown
Image
We can see that internal name of the Branch Type is "BANK_BRANCH_TYPE". We need to ensure that a DFF can be made sensitive to the value in BANK_BRANCH_TYPE
Image
Lets navigate to DFF registration screen, and using the table name, we query DFF for AP_BANK_BRANCHES.
Image
Alternately you can query using DFF title too.
Image

Image
Now lets add BANK_BRANCH_TYPE as a REFERENCE Field, by clicking on Button Reference
Image
Now we need to define the new fields(segments). This screen is accessed via menu /Descriptive/Segments . In this screen, lets make BANK_BRANCH_TYPE as the context/reference. This means that DFF will become sensitive to values in Branch Type field
Image
IMPORTANT: If your requirement is not to have any conditiional logic, then no need for all the "Reference Field" blaaa. All you need to do is to add your segment to Global Data Elements
Image
Image
Image
Image
Image
When the user selects Type=SWIFT, we see the relevant SWIFT field appear in Flexfield window
Image

When user selects Type=CHIPS, we see CHIP Id field appearing in Flexfield window.
Image
Here we now see that value entered in DFF field gets stored in the database column,
Image

1 comment:

  1. Good Stuff!! Thanks for posting. If anyone is looking for oracle apps technical online training. Please enroll.
    https://www.gologica.com/course/oracle-apps-technical/

    ReplyDelete