Professional Documents
Culture Documents
Sample CUSTOM Library Code To Customize Applications
Sample CUSTOM Library Code To Customize Applications
[ID 744065.1]
In this Document
Purpose
Based on Tab
Based on Button
Based on Blocks
Validations
Based on Users
Zoom
Special
Applies to:
Purpose
Based on Fields
end if;
end if;
Result:
end if;
Result:
How to change the background color for the field ‘Payment Terms’?
app_item_property2.set_property('ORDER.TERMS',BACKGROUND_COLOR,'r255g0b255');
end if;
end if;
Result:
Result:
For Changing the prompt of field Order Number on the Release Sales Order form
end if;
Result:
How to make a field non editable field but the values needs to be defaulted?
if (event_name = 'WHEN-NEW-ITEM-INSTANCE') then
VALIDATE (item_scope);
end if;
The Customer Name field is grayed out but the value is passed by using Copy function.
Result:
Based on Tab
Hiding Tab
my_tab_page_id TAB_PAGE;
begin
SET_TAB_PAGE_PROPERTY(my_tab_page_id,VISIBLE,property_FALSE);
end if;
Result:
Renaming Tab
my_tab_page_id TAB_PAGE;
begin
Result:
Based on Button
end if;
Result:
end if;
Result:
Based on Blocks
end if;
Result:
Validations
How to ensure user enters not more than 3 characters in ‘Customer PO’ field and exits the field ?
if LENGTH(name_in('ORDER.CUST_PO_NUMBER'))>3
and
GET_ITEM_PROPERTY('ORDER.CUST_PO_NUMBER',UPDATE_COLUMN) = 'TRUE'
then
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;
end if;
Result:
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
(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.set_string('Entered quantity is Odd -- so no
problem');
fnd_message.show();
end if;
end if;
Result:
on entering odd number. Navigation to next line allowed only on entering odd number
Zoom
For example to open the Onhand Quantity from Item Description field in lines tab of Sales Order form
FUNCTION zoom_available
RETURN BOOLEAN
IS
BEGIN
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.
b varchar2(20);
begin
open_flag => 'Y',
session_flag
=> 'Y',
other_params
=> 'ITEMS="' || param_to_pass1 || '"' );
end if;
end if;
if (event_name = 'WHEN-NEW-RECORD-INSTANCE') then
if (form_name = 'INVMATWB' AND block_name = 'MATERIAL_QF') then
b := fnd_profile.VALUE ('user_name');
fnd_message.set_string (NAME_IN ('parameter.ITEMS')||'is entered by user' ||b);
fnd_message.show ();
GO_ITEM ('MATERIAL_QF.ITEM');
COPY (NAME_IN ('parameter.ITEMS'), ('MATERIAL_QF.ITEM'));
VALIDATE (item_scope);
END IF;
end event;
Result:
At header
level zoom button is not active
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
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
end if;
);
session_flag
=> 'Y'
end if;
end if;
Result:
This is similar to switching off the custom code using Help --> Diagnostics --> Custom --> Custom Off
switched off. This does
Note:
Switching off customization means that Codes written in custom library
and for personalization are
not switch off
Custom triggers or Custom code written on the standard forms.
;
ELSE
( 'NORMAL' , 'GLOBAL.APP_CUSTOM_MODE' ) ;
copy
END IF ;
END IF ;
References
NOTE:743490.1 - Customization in Oracle Applications
Attachments
Related
Products
Oracle E-Business Suite > Order Management > Order Management > Oracle Order Management
Keywords