Wednesday, February 5, 2014

Form Personalization in Oracle Apps

Q. Have you heard about Zoom function in Oracle Apps Forms?
Yes. It is CUSTOM.ZOOM_AVAILABLE function

Q. What is the use?
Generally the function CUSTOM.ZOOM_AVAILABLE was used for navigation from a block to another and it by default returns BOOLEAN value; False. It was used in earlier time in Oracle Apps. Now we are using Open_Form, Call_Form etc.
Ex: If Zoom is available for this block, then return TRUE; otherwise FALSE.Always test for the form and block name. Refer to the SYSTEM variables for form name and block name in your code and branch accordingly. The module name of your form must match the form file name.

By default this routine must return FALSE.
The following example enables Zooms in the following places:

Form: FNDSCAUS, Block USER and
Form: FNDCPMCP, Block PROCESS
FUNCTION zoom_available RETURN BOOLEAN IS
form_name  VARCHAR2(30)  := NAME_IN(‘system.current_form’);
block_name VARCHAR2(30)  := NAME_IN(‘system.cursor_block’);
BEGIN
IF (form_name = ’FNDSCAUS’ AND block_name = ’USER’) OR
       (form_name = ’FNDCPMCP’ AND block_name = ’PROCESS’)
THEN
    RETURN TRUE;
ELSE
    RETURN FALSE;
END IF;
                    END zoom_available;

Q. What is the sequence of Trigger firing in Form?
                     a) Pre-Form
b) Pre-Block
c) Pre-Record
d) Pre-Text-Item
e) When-New-Form-Instance
f) When-New-Block-Instance
g) When-New-Record-Instance
                     h) When-New-Item-Instance
i) Post-Text-Item
j) Post-Record
k) Post-Block

l) Post-Form

Q. What is the process of Form registration in Oracle Apps?

  • Send the file through FTP in binary mode to …/forms/US
  • Generate *.fmx by running the fmx script
  • f60gen module=<FORMNAME.fmb> userid=APPS/adm1n output_file=<FORMNAME.fmx> module_type=form batch=no compile_all=special

Q. What is the default directory of Forms in Oracle Apps?
Application top(autop)/forms/US

Q. How can we disable a form from the menu?
System Administrator (Responsibility) > Security > Responsibility -> Define (at Menu) > Find Responsibility Name & The Menu attached to it >  Exclusion > Exclude the Function of the Form

Q. How can you call DFF from Form?
By using a procedure called fnd_descr_flex.define
Ex: FND_DESCR_FLEX.DEFINE(BLOCK=>’ORDER_DETAIL’,  FIELD=>’DESCFF’,
                                                 APPL_SHORT_NAME=>’FND’,
                                                 DESC_FLEX_NAME=>’MYDESC’)

In Brief,
We need to follow the following steps in your form:
a) Create a displayed field to hold your concatenated segment values (the [ ] field).
b) Create fields (normally hidden) for each of the flexfield columns in your table (the
      one used for your flex).
c) In the form-level WHEN-NEW-FORM-INSTANCE,
call FND_DESCR_FLEX.DEFINE,
setting BLOCK parameter to the name of the block containing your [ ] field,
the FIELD parameter to the name of your [ ] field,
the APPL_SHORT_NAME parameter to the short name of your application and the DESC_FLEX_NAME parameter to the name of your descriptive flex.

In the form-level WHEN-NEW-ITEM-INSTANCE,
WHEN-VALIDATE-ITEM,
PRE-INSERT,
PRE-UPDATE,
POST-QUERY and
PRE-QUERY triggers place a call to FND_FLEX.EVENT as follows:
         FND_FLEX.EVENT ( 'TRIGGER_NAME');
where TRIGGER_NAME is the name of the trigger,
e.g. in the PRE-QUERY trigger .... FND_FLEX.EVENT('PRE-QUERY');
---------------------------------------------------------------------------------------------------------------------------------------------------------
Oracle has provided a simple and easy feature to implement the customer specific requirements without modifying the underlying forms code or CUSTOM library. Although CUSTOM library still can be used for forms customization to implement the complex business logic, the personalization feature provided in the latest release is easy, faster and requires minimum development effort.
If user needs to personalize any details in a form like changing field names, adding some validations, etc, then Form Personalization can provide the way out in few simple steps.
Please follow here to go through Steps with example

Steps:

Step – 1:

Go to the specific form where you need the changes

Then we need to note down the block and field name which is needed in next steps.
So keep the cursor on the required field and then Go to Help --> Diagnostics --> Examine


Note down the Block and Field value.

Step -2:

Now the step to do the personalization
Follow this navigation
Help à Diagnostics à Custom Code à Personalize

This will show the Form Personalization window

Here you need to do the customization as per the requirement.
As you can see in this form, there are mainly 4 sections
1.       Rule
2.       Condition
3.       Actions
4.       Context

Step – 3:

Rule:

This is the section where you need to create the rules how your requirement is going to be executed. This section contains 4 segments, Seq, description, Level and Enabled flag.
Seq : Need to give the Sequence how the rule will execute (a number)
Description: Write a sort description of the rule which you are going to create
Level: Select the level where you want the rule to execute
Enabled: This is the flag which will enable or disable the rule.
Example:

Step – 4:

Condition:

Now need to set the condition.
This is the section where you will define when the rule will be executed.
This section contains 4 segments, Trigger Event, Trigger Object, Condition and Processing mode.
Trigger Event: This specifies where the rule will be executed. There are mainly 5 types of event which decided the trigger of the rule.

Trigger Object:  This is the Object in the form which decides at what level the rule will be executed.
The values can be “<Form Name>”, ‘<Block Name>” or “<Item Name>”
Condition: Here mention any SQL statement to control the execution of the rule when the mentioned criterion is met.
Processing Mode: This is the mode where you want the rules to be executed.
Example:

Step – 5:

Actions:

This decides what will happen when the rule will execute.
This contains 2 sections.
Left sections contains Seq, Type, Description, Language, Enabled
Seq: Mention the Action sequence which this rule will execute
Type: This is of 4 types, Property, Message, Builtin, Menu.
This decides which type of action, the rule will perform.
According to this the right section will come and need to fill the detailed actions.
Description: Write a description on the action which this will perform.
Language: Select the language
Enabled: You can enable or disable the actions here.
Right Section is a dynamic section; it appears depending on the Type field value in Left section.

Action Types:

Property
The action type “Property” is used to set the properties of the objects. The various objects include
“Item, Window, and Block etc.”.  Actual object name defined in the form should be entered after selecting the object type.
Property Name is the property to be changed
Value is the new desired value for the property.
The current value of the property will be displayed when clicked on the “Get Value” button.
Example:
Object Type = “Item”
Target Object = “:ORDER.ORDER_NUMBER”
Property Name = “PROMPT_TEXT”
Value = “Claim Number”
The value is interpreted at runtime, so you can use SQL functions and operators. Any value started with “=” operator will be interpreted at runtime; otherwise the value is treated as is entered in the value field

Message:
The action type “Message” is used to display custom messages during runtime. Message Type and Description should be entered after selecting the action type as “Message”. The available message types are “Error, Warning, Hint, Question and Debug”. Depending on the response expected from the user, the appropriate message type should be selected.
Example:
Message Type = “Hint”
Message Text = “Please Follow the Date format DD-MON-YYYY”

Builtin:
The action type “Builtin” is used to execute the form and AOL API’s. Depending on the API type selected, the parameters should be entered.
Example:
Builtin Type = FND_UTILITIES.OPEN_URL
Argument = http://www.oracle.com

Menu:
The action type “Menu” is used to activate the available special menus on the Tools menu.
Oracle Applications provide 45 special menus under Tools menu which can be used by customers based on their requirements.
Select the SPECIAL menu which is not used by the form. Menu label is the prompt which appears to the users when Tools menu is invoked, block specifies the blocks for which the special menu should be activated and Icon name is the .ico file name.
A separator can be created above the activated special menu by selecting the “Render line before menu” checkbox.
Example:
Menu Entry = SPECIAL4
Menu Label = Additional Order Header Information
Enabled in Blocks(s) = ORDER
Icon Name = Flower.ico

Step – 6:

Context:

Context manages to whom the personalization should apply. This is similar to the concept of using profile options in Oracle Applications. The various levels are Site, Responsibility, Industry and User. During runtime, the values provided in the context are evaluated and personalization rules will be applied. Usage of context is very vital in implementing the personalization to prevent the inappropriate users accessing these customizations of the form.
Example:
Context = Responsibility
Value = Order Management Super User


Step by Step Analysis

Requirement: Don’t allow the user to use more than 1 qty in Order line Qty field during creation of a sales order.

Solution:

Step -1:
Go to the specific form where you need the changes
Here in this case this will be the Sales Orders form and then Line Items tab.

Then we need to note down the block and field name which is needed in next steps.
So keep the cursor on the required field and then Go to Help à Diagnostics à Examine


Note down the Block and Field value.
Step -2:
Help --> Diagnostics --> Custom Code --> Personalize

Step – 3:
Fill the Rule section

Step – 4:
Fill the Condition section

Step – 5:
Fill the Actions section

Step – 6:
Fill the context As you need.
Save this.
Log out of the application and login again, then in Sales Order line item tab enter Qty field value as 1 and try to save, you can see the message.

No comments:

Post a Comment