11 - FORMS - Oracle Forms Personalization Training Manual PDF
11 - FORMS - Oracle Forms Personalization Training Manual PDF
11 - FORMS - Oracle Forms Personalization Training Manual PDF
Step 2: In this example we are trying to change the prompt of one of the fields in the Form
to achieve what we need. Access the personalization screen by following the navigation
given in the screen shot below
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 3: You must see the following form. Also please read the explanations given against
each of the fields in the form
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 5: Save the personalization. Exit the form and re-launch it and you must see
something like this now.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 2: What we are trying to achieve in this form is that whenever the Description field
is entered as “No Rank” then the Rank field should get disabled
In order to enter the condition as shown in the screen shot shown above. Follow the steps
below .
Navigate into the Condition box.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Once you click ok in the above box you will get something like :
${item.ap_terms.description.value} in the Condition box. To this add =’No Rank’
Step 4: Now navigate to the Actions tab
Step 5: Now save the personalization . Close the Form and re-launch it again . Try
entering the Description field as No Rank and then navigate to the Rank field and observe
that the field is disabled for insertion
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
In a similar manner fields which are otherwise disabled for update can be enabled by
setting the Insert Allowed property to True
III. Launching URLs through Forms Personalization
Step 1: Open up the Payment Terms form once again. What we are trying to achieve
through this personalization is demonstrated in the screen shot below
Then final result here will be that when the user clicks on the Launch Google menu
item in the Actions Menu the google page must open up. Let us see how this can be
done.
Step 2: Navigate to the Personalizations form. The first thing we have to do is to create
a Menu item in the Actions Menu which can be used as a hook to launch the URL .
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 4: Next let us write a capturing point for this trigger event
SPECIAL:35. It must be noted that all SPECIAL trigger events can be initialized / set
only in the WHEN-NOW-FORM-INSTANCE trigger
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 2: Before we create a personalization that will call a PL/SQL procedure we need to
create a simple ‘do-nothing’ pl/sql procedure. We will pass one argument to this
procedure to see how values from a Form can be passed into a PL/SQL procedure
through personalization
Step 3: Let us create a dummy PL/SQL procedure first. From your SQL*Plus enter the
following
CREATE OR REPLACE PROCEDURE TEST_PLSQL_FORM_PER (text IN VARCHAR2)
IS
BEGIN
CREATE OR REPLACE PROCEDURE TEST_PERSONALIZATION(p_text_argument_in IN VARCHAR2)
IS
BEGIN
INSERT INTO fnd_log_messages
(module, log_level, MESSAGE_TEXT, user_id, TIMESTAMP,AUDSID
,log_sequence)
VALUES ('AP', 1, p_text_argument_in, fnd_global.user_id, SYSDATE,-99
,fnd_log_messages_s.NEXTVAL);-- This will help us know if the
personalization fired and entered a row into this table. This is a table used for
writing log messages in Oracle Apps
COMMIT;
END TEST_PERSONALIZATION;
Step 4: The first step is to create a menu item to provide us with a hook to call a PL/SQL Procedure.
Open up the personalization form and enter the following personalization rule and actions
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 6: Now finally save the personalization . Close the form and relaunch it and you
should see something like this
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Step 7: Verify from the fnd_log_messages table that a row has got inserted with the
description we used above.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
The function name can be seen from the Personalization screen at the top left corner.
Upload:
FNDLOAD <userid>/<password> 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct
<filename.ldt>
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Create a User
1. Log in as sysadmin/sysadmin and select the System Administrator responsibility. Navigate to the
Users window.
(N) Security > User > Define
2. Enter a user name: <first initial> <last name>
3. Enter a password twice.
4. Assign the user the Customer Support , Vision Operations or the Service responsibility, depending on
which one you are using in the class.
Normally, you are required to enter an employee resource in the Person field, but we will ignore this
requirement for this practice.
5. Switch responsibility to the Customer Support , Vision Operations or the Service responsibility,
depending on which one you are using in the class.
Find the Field Name of the Addressee Field on the Contact Center’s Address Tab
6. Navigate to the Contact Center.
(N) Customer Management > Contact Center
7. Select the Addresses tab.
8. Place your cursor in the Addressee field.
9. From the Help menu, choose Diagnostics > Examine.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
10. Enter the password “apps” in the Enable Diagnostics field and click OK. The Examine Field and
Variable Values window appears. The field name is the combination of the Block and Field name
separated with a period ".": ADDRESS.ADDRESSEE
Hide the Field for the User Through Oracle Forms Personalization
12. Turn on Forms personalization
(M) Help > Diagnostics > Custom Code > Personalize
The Form Personalization window appears.
14. Enter a number in the Seq field. To ensure all the numbers in the class are unique, enter: 1<student no.>,
for example: 101.
15. Enter a description. Include the user name to distinguish your personalization from others in your
class: “Hide the address field for user <user name>”
16. Leave the Trigger Event as WHEN-NEW-FORM-INSTANCE and Processing Mode: Not in Enter-
Query Mode.
17. In the Context region enter User as the Level and the user name you created for the Value. This
specifies that your personalization applies only to that one user.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Field Value
Action Seq 1
Type Property
Language All
Enabled check box selected
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
23. Save.
24. Exit Forms by clicking the X close icon on the top right-hand corner of the window and return to the
Home page. This is a separate browser window.
25. Logout of the application by selecting the Logout link.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
2. Open the Personalization form from the pull down menu Help => Diagnostics => Custom Code =>
Personalize.
Actions tab :
Sequence: 10
Type: Property
Object Type: Item
Target Object: WORK_ORDER.SCHEDULE
Property Name: DISPLAYED
Value: FALSE
4. Save your personalization rule and exit the form and re-enter to see the result. You will notice that the
Schedule button on the Submit Request Form is no longer displayed for this specific user. Similar action
can be taken on other buttons as well
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
How to change the height or width of a List Of Values associated with a form?
1.Navigate to the Form which is having the LOV Item
2.Open the Personalization form from the pull down menu Help => Diagnostics => Custom Code =>
Personalize.
3. Implement the following Personalization rule :
Seq: 10
Description: Increase the width of the LOV
Condition:
Trigger Event: WHEN-NEW-FORM-INSTANCE
Trigger Object: Null
Condition: Null
Processing Mode: Both
Context:
Level: Site
Value: Null
Action:
Seq: 10
Type: Property
Description: Width of the LOV
Language: All
Object Type: LOV
Target Object: <Name of the LOV>
Property Name: WIDTH
<Press the button "Get Value" to retrieve the current width of the LOV in the Value field>
Value: <Increase the value for the width>
However please note that to increase the width of a particular column of a LOV user needs to change the
property of the column(Column mapping) for the LOV item from the Forms Builder.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
A1:
This Feature is available from RUP3 '11i.ATG_PF.H RUP3' PATCH 4334965
1. Navigate to the Form which is having the LOV Item.
Seq: 10
Description: Increase the width of the LOV
Condition:
Trigger Event: WHEN-NEW-ITEM-INSTANCE
Trigger Object: <Name of the text item having the LOV in the Block_Name.Item_Name
format>
Condition: Null
Processing Mode: Both
Context:
Level: Site
Value: Null
Action:
Seq: 10
Type: Builtin
Description: Create Record Group
Language: All
Builtin Type: Create Record Group From Query
Argument: <Custom SQL query to populate the data in the LOV>
[Please note that the number of collumns must be the same
as the seeded record group so that LOV column mapping do
not violate]
Group Name: <Enter some record group name>
Seq: 20
Type: Property
Description: Attach the Record Group to the LOV
Language: All
Object Type: LOV
Target Object: <Name of the LOV>
Property Name: GROUP_NAME
Value: <Name of the Record Group created in the previous action>
-------------------------
Example: Customize the Application Name LOV to populate the Application Name starting with "C" in
the Application Developer > Application > Forms
-------------------------
Seq: 10
Description: Increase the width of the LOV
Condition:
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
Action:
Seq: 10
Type: Builtin
Description: Create Record Group
Language: All
Builtin Type: Create Record Group From Query
Argument: select APPLICATION_NAME, APPLICATION_ID
from FND_APPLICATION_VL
where APPLICATION_NAME like 'C%'
order by APPLICATION_NAME
Group Name: RG_APPLICATION
Seq: 20
Type: Property
Description: Attach the Record Group to the LOV
Language: All
Object Type: LOV
Target Object: APPLICATION_LOV
Property Name: GROUP_NAME
Value: RG_APPLICATION
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
2] If you type a string in that does not start with ‘=’, then the exact value you type in will be used at
runtime.
3] If the string you type starts with ‘=’, then the text immediately after that character will be evaluated at
runtime. This allows you to write complex logic that can include references such as:
SQL operators, such as ||, TO_CHAR, DECODE, and NVL
Bind variables (:block.field), including: system: global and: parameter values. Use the ‘Add Item…’
button to assist with item names.
Calls to server-side functions that do not have OUT parameters.
Here is a simple example using a function in the database that queries values, then a personalization that
sets the value queried. This example is defined in the miscellaneous transactions form (INVTTMTX.fmb)
and passes the Project Information (Project Number, Task Number, Expenditure Type and Expenditure
Org) to the function.
=select xx_getaccount_pkg.main(''||${item.MTL_TRX_LINE.ITEM.value}||'',
''||${item.MTL_TRX_LINE.SOURCE_PROJECT_NUMBER.value}||'',
''||${item.MTL_TRX_LINE.SOURCE_TASK_NUMBER.value}||'',
''||${item.MTL_TRX_LINE.EXPENDITURE_TYPE.value}||'',
''||${item.MTL_TRX_LINE.EXPENDITURE_ORG.value}||'') from dual
Note that the variable in this case is written as “${item.MTL_TRX_LINE.ITEM.value}”. The text
“MTL_TRX_LINE.ITEM.” is the Block and Field where the item number is written. The syntax around the
block and field name ensures that the callout is made to replace the value of the item before passing the
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
text to the function. You can use similar naming for your own fields finding the name of the Block and
Field using Help > Diagnostics > Examine. Also don’t put semicolon (;) after the statement.
Open the form that you want to personalize, then choose Help > Diagnostics > Custom Code >
Personalize. In this case, the miscellaneous transactions form is opened.
Enter the main information about when this personalization will be active.
Use the ‘Validate’ button to test if the syntax of your string is valid. If the evaluation fails, the processing
engine will return an ORA error as if the string had been part of a SQL expression. Otherwise, it will
display the text exactly as it would appear at runtime in the current context.
Enter the action information detailing what the personalization will do. Here select the ‘Property Name’
as VALUE and then put the above sql statement.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
In this case, the Project Information (Project Number, Task Number, Expenditure Type and Expenditure
Org) is passed from the screen to the database function. The function then derives the GL Account from
the above parameters. The value is then replaced for the Account field on the screen.
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
How to change the background color for the field ‘Payment Terms’?
For example how to Change the background color to Fuchsia(r255g0b255)
if (event_name = 'WHEN-NEW-FORM-INSTANCE') then
if (form_name = 'OEXOEORD') then
app_item_property2.set_property('ORDER.TERMS',BACKGROUND_COLOR,'r255g0b255');
end if;
end if;
How to make a field non editable field but the values needs to be defaulted?
For disabling the field
if (event_name = 'WHEN-NEW-ITEM-INSTANCE') then
if (form_name = 'OEXOEORD' AND block_name = 'ORDER') then
COPY ('Business World', 'ORDER.SOLD_TO');
VALIDATE (item_scope);
app_item_property2.set_property ('ORDER.SOLD_TO', enabled, property_false);
end if;
end if;
The Customer Name field is grayed out but the value is passed by using Copy function.
Based on Tab
Hiding Tab
How to hide Lines Tab in Sales Order form?
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
my_tab_page_id TAB_PAGE;
begin
if (event_name = 'WHEN-NEW-FORM-INSTANCE') then
if (form_name = 'OEXOEORD') then
my_tab_page_id := FIND_TAB_PAGE('ORDER_REGIONS.LINE_ITEMS');
SET_TAB_PAGE_PROPERTY(my_tab_page_id,VISIBLE,property_FALSE);
end if;
end if;
Renaming Tab
Based on Button
How to hide Book Order Button?
if (event_name = 'WHEN-NEW-FORM-INSTANCE') then
if (form_name = 'OEXOEORD') then
app_item_property2.set_property('ORDER_CONTROL.BOOK_ORDER',displayed,
PROPERTY_false);
end if;
end if;
Based on Blocks
How to make a block read-only ?
if (event_name = 'WHEN-NEW-FORM-INSTANCE') then
if (form_name = 'OEXOEORD'and block_name = 'ORDER') then
set_block_property(block_name, insert_allowed,property_false);
end if;
end if;
Validations
How to ensure user enters not more than 3 characters in ‘Customer PO’ field and exits the field ?
if (form_name = 'OEXOEORD') then
if LENGTH(name_in('ORDER.CUST_PO_NUMBER'))>3
and
GET_ITEM_PROPERTY('ORDER.CUST_PO_NUMBER',UPDATE_COLUMN) = 'TRUE'
then
V_REC_NUM := name_in('SYSTEM.CURSOR_RECORD');
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
SET_RECORD_PROPERTY(V_REC_NUM,'INV_SUM_FOLDER',STATUS,NEW_STATUS);
fnd_message.set_name('FND','PO Number must be <= 3 characters');
fnd_message.Error;
RAISE FORM_TRIGGER_FAILURE;
end if;
end if;
Based on Users
How to prevent a particular user from entering an Odd quantity for a particular item?
b := fnd_profile.VALUE ('user_id');
if (b = '1008697') then
if (event_name = 'WHEN-VALIDATE-RECORD') then
if (form_name = 'OEXOEORD' AND block_name = 'LINE') then
if (NAME_IN ('LINE.ORDERED_ITEM_DSP') = 'AS54888') then
if (MOD (NAME_IN ('LINE.ORDERED_QUANTITY'), 2) = 0) then
fnd_message.set_string ('Even quantities for '
||NAME_IN(LINE.ORDERED_ITEM_DSP)|| ' not allowed');
fnd_message.show ();
RAISE form_trigger_failure;
end if;
fnd_message.set_string('Entered quantity is Odd -- so no problem');
fnd_message.show();
end if;
end if;
end if;
end if;
on entering odd number. Navigation to next line allowed only on entering odd number
Zoom
How to enable Zoom for a particular form?
For example to open the Onhand Quantity from Item Description field in lines tab of Sales Order form
To enable the Zoom function
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 = 'OEXOEORD' AND block_name = 'LINE') then
RETURN TRUE;
else
RETURN FALSE;
end if;
END zoom_available;
Following code helps to Onhand Quantity Form and to pass the item name to Onhand Quantity from
Sales Order Form and navigate to Item field while clicking the Zoom button.
procedure event(event_name varchar2) is
param_to_pass1 VARCHAR2 (255);
b varchar2(20);
begin
if (event_name = 'ZOOM') then
if (form_name = 'OEXOEORD' AND block_name = 'LINE') then
param_to_pass1 := NAME_IN ('LINE.ORDERED_ITEM_DSP');
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
After entering an item, click the zoom button to open the Onhand Quantity Form, the form will ask for
organization to be selected
Item name will be passed to Onhand Quantity Form, The message will be displayed mentioning the item
and the user name passed by the user.
The onhand quantity form will be opened with item description and cursor will navigate to Item field in
Onhand Quantity Form.
Special
How to enable a Special button?
Below is an example showing the menu button from sales order form
a menuitem;
Begin
a := FIND_MENU_ITEM ('SPECIAL.SPECIAL15');
if (event_name = 'WHEN-NEW-BLOCK-INSTANCE') then
if (form_name = 'OEXOEORD' AND block_name = 'LINE') then
app_special2.instantiate ('SPECIAL15', 'Query Form');
SET_MENU_ITEM_PROPERTY (a, displayed, property_true);
SET_MENU_ITEM_PROPERTY (a, enabled, property_true);
end if;
end if;
if (event_name = 'SPECIAL15') then
if (form_name = 'INVIDITM') then
fnd_function.EXECUTE (function_name => 'INV_INVMATWB',
open_flag => 'Y',
session_flag => 'Y' );
end if;
end if;
RAJU CHINTHAPATLA
FORMS – Oracle Forms Personalization Training Manual Raju Chinthapatla
This is similar to switching off the custom code using Help --> Diagnostics --> Custom --> Custom Off
Note: Switching off customization means that Codes written in custom library and for personalization are
switched off. This does not switch off Custom triggers or Custom code written on the standard forms.
RAJU CHINTHAPATLA