YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Forms Configurator Setup

Forms Configurator Setup & Usage Guide [ID 206035.1]

Modified 10-AUG-2010 Type WHITE PAPER Status PUBLISHED

Checked for relevance on 13-MAR-2008

Setup and Usage Guide

Oracle Human ResourcesForms Configurator

Release 11i

Table of Contents

Introduction Consolidated listing of all setup information contained within manuals Example Set Up Steps to verify the setup is correct

Introduction

The primary purpose of this document is to assist customers in configuring a task flow for a custom form created using Forms Configurator. It must be used in conjunction with the existing product documentation. This document provides step-by-step instructions for an example set up of adding a taskflow to the element entries form from a custom form created with the Forms Configurator template,” US Maintain Employees”.

Consolidated listing of all setup information contained within manuals

Note: 130795.1 Forms Configurator and People Management Release 11i, Chapter 1, Forms Configurator and People Management, page 7

Note: 119843.1 Forms Configurator – Options

[Top]

Example Set Up

1. Create a custom Form

US HRMS Manager responsibility

+Security/Forms Configurator

LOV choose template code

PER_MAINTAIN_EMPS US Maintain Employees

Page 2: Forms Configurator Setup

<COPY>

In copy to section

Template Code NN_PER_MAINTAIN_EMPS

Template Name NN US Maintain Employees

Enabled YES

Legislation US

<OK>

<YES>

+NN US Maintain Employees

Change Date <NO>

In designer open the template

+NN US Maintain Employee

+Items

+Button 1 (Taskflow)

visible = Yes

Enabled = Yes

<save>

+Button 2 (Taskflow)

visible = yes

Enabled = Yes

<save>

+Button 3 (taskflow)

visible = yes

Enabled = Yes

<save>

Page 3: Forms Configurator Setup

+Button 4 (taskflow)

visible = yes

Enabled = Yes

<save>

+Button 5 (taskflow)

visible = yes

Enabled = Yes

<save> Close designer

2. Create the taskflow

From main menu

+Security/Task flow definitions

Create a new taskflow

Name: NN TASKFLOW

Legislation: UNITED STATES

NODE

Name: PEOPLE_MANAGEMENT <TOP NODE CHECKED>

Down arrow

Name: ELEMENTS <TOP NODE UNCHECKED>

Arrow up Make sure NAME IS BACK TO PEOPLE_MANAGEMENT

NAVIGATION OPTIONS

1 Elements button clicked

<SAVE>

Close window

3. Complete System Administrator Tasks

Switch responsibility to system administrator

Page 4: Forms Configurator Setup

+Application/Function

Enter

Function: PERWSQHM_NN

User Function Name: NN People Management - Elements

Tab to the right make sure type = FORM

Click in the Form TAB

Form: People Management

Application: Oracle Human Resources

Parameters: TEMPLATE_NAME="NN_PER_MAINTAIN_EMPS" WORKFLOW_NAME="NN TASKFLOW"

Save and close form functions.

+Application/Menu query user menu Name:

US HRMS Navigator or whatever menu you are using.

Add a new sequence to the bottom

seq 91 <what ever number you want to use>

Prompt: NN Test Template

Function: NN People Management - Elements

SAVE

4. Finish Set Up

Log completely out of application and log back in as US HRMS Manager

Look at the bottom of the menu you will see

NN Test Template (NOTE: This function can be placed elsewhere on

the menu if you like)

[Top]

Steps to verify the setup is correct

Page 5: Forms Configurator Setup

Open NN Test Template

Effective date NO

People by Name

Select your employee

Show details

Entries tab is there click that you now have elements

Related

Products

Oracle E-Business Suite > Human Capital Management > Human Resources > Oracle Human Resources

Page 6: Forms Configurator Setup

Forms Configurator - Options [ID 119843.1]

Modified 26-FEB-2010 Type BULLETIN Status PUBLISHED

Checked for relevance on 26-Feb-2010

Related Documents -----------------

NOTE:119841.1 - Forms Configurator Overview

FORMS CONFIGURATOR - OPTIONS-----------------------------

The following is a description of the configuration options you can use whendesigning your template. The options are shown in the order that they appearon the Forms Configurator tool.

Template Properties

Template Code Displays the internal name for the template. This code in combination with the Legislation uniquely identifies the template. You use this name when adding the window to the user's menu.

Template Name Specifies the descriptive name of the template.

Enabled ~~~~~~A template can be enabled or disabled. You can only choose the Run Template option from the Tools menu for a template that is enabled and linked to a menu. Disable a template when it is no longer in use.

Legislation~~~~~~~~Specifies the legislation of the template. Leave the legislation option blank to create a generic template.

The system automatically displays the appropriate legislative versionof a template for a user, or the generic version if there is no legislativeversion that matches the legislation of the user's Business Group.

Description~~~~~~~~A longer description of the template can be provided.

Help Target~~~~~~~~~You can add your own help target to display a particular help topic. This willoverride the default context-sensitive help call of the form.window name.

Note: The target you enter here will have the name of the window from whichyou have called help appended to it. Together these form the complete target.

Page 7: Forms Configurator Setup

For example, if you have defined a help target called HIREPER for your template and you call help from the Summary window, then the help target generated will be HIREPER.SUMMARY_WINDOW.

Online Help Targets for Templates

Further Information~~~~~~~~~~~~~~Use this flexfield to enter additional configuration information for thetemplate. For example, for the People Management templates this flexfield enables you to specify which window is displayed first and which person typesare allowed.

Window Properties

Window Name ~~~~~~~~~~~Specifies the name of the selected window. There are three windows available:Summary, Find, and Maintenance

Title ~~~~Specifies the title of the window. This name will be displayed at the top leftof the window.

Height~~~~~Sets the height of the window in inches.

Width ~~~~Sets the width of the window in inches.

X Position and Y Position~~~~~~~~~~~~~~~~~~~~~~~~~Sets the position of the window using co-ordinates. X sets the horizontal position and y sets the vertical position. Alternatively, you can use thearrow keys to move the window around.

Canvas Properties

Canvas Name ~~~~~~~~~~~Specifies the name of the selected canvas. The canvases available depends onthe window you are creating:

Background Canvases

The Maintain, Summary, and Find canvases fill in the background of the window. You cannot amend the properties of these canvases.

Tab Canvases

The Maintain Tabs, Summary Tabs, and Find Tabs canvases define the area of thewindow in which you will be able to define tabs.

Page 8: Forms Configurator Setup

Find Results Canvas

The Find Results canvas defines the area of the window in which you will be able to define the Find Results region.

Visible ~~~~~Set this to Yes if you want the canvas to be displayed to the user.

Height ~~~~~Sets the height of the canvas in inches.

Width ~~~~~Sets the width of the canvas in inches.

X Position and Y Position~~~~~~~~~~~~~~~~~~~~~~~~~~Sets the position of the canvas using co-ordinates. X sets the horizontal position and y sets the vertical position. Alternatively, you can use the arrow keys to move the canvas around.

Tab Page Properties

Tab Page Name Displays the name of the tab. The tabs available to you dependon the window you are editing:

Find - The find window has six tabs you can set up for any use.

Maintain - The Maintain window has ten tabs available. Three tabs have beenset up to be used specifically for Extra Information Types (EIT), Special Information Types (SIT), and the checklist.

Summary - The Summary window has ten tabs available. One tab has been set up to be used specifically for the checklist.

Visible~~~~~~Set this to Yes if you want the tab to be displayed to the user.

Label ~~~~This only applies to buttons or check box items. The label describes the button or individual check box.

If the item is a check box or button you can define an access key(or keyboard shortcut) by preceding the appropriate letter in the label with an ampersand (&). For example, to use ALT+P (in the Microsoft Windowsenvironment) as the access key for the Picture window, enter the label&Picture.

Do not use the following letters since they are used on the Oracle Applicationsmenu: A, E, F, G, H, Q, S, W. There is no validation to prevent the same letter

Page 9: Forms Configurator Setup

being used more than once in the same window.

Navigation Direction ~~~~~~~~~~~~~~~Sets the tabbing order for the items in the tab. This can be left to right, or top to bottom.

Item Properties

Item Name ~~~~~~~~~The item name is the name of the data item or field, such as LAST_NAME, you have currently selected in the Forms Configurator Items branch. If you areworking with a predefined template, only the fields used in that template are displayed on the Forms Configurator Items branch. You can add other fields toyour template from the form.

Window Name ~~~~~~~~~~~Displays the window name on which the field is used. You cannot change thisproperty. Each field has an associated window. There are three windows available: Summary, Find, and Maintenance.

Tab Page Name ~~~~~~~~~~~~~Displays the name of the tab or tabs in the window where the field will bepositioned. You can choose a tab by clicking the button next to this field tosee the available tab pages you can use.

Visible ~~~~~Set this to Yes if you want the field to be displayed to the user. If it is set to No, the user will not see the field but the field and its value arestill in use. For example, the Secure check box on the Find window is notvisible but the box has been checked. The user cannot see the check box on the window but the security restriction still applies.

Height ~~~~~Sets the height of the field in inches.

Width ~~~~~Sets the width of the field in inches.

X Position and Y Position ~~~~~~~~~~~~~~~~~~~Sets the position of the field using co-ordinates. X sets the horizontal position and y sets the vertical position. Alternatively, you can use thearrow keys to move the field around.

Enabled ~~~~~~~Specifies whether the user can put their cursor into this field. If it is set to No, the user can see the field but cannot do anything to it.

Page 10: Forms Configurator Setup

Required ~~~~~~~Set this to Yes if you want to make the field mandatory.

Query Allowed ~~~~~~~~~~~~Specifies whether the user can run a query in this field.

Note: This property is ignored in the People Management templates. You canonly run queries using the Find window.

Insert Allowed ~~~~~~~~~~~Specifies whether the user can insert new data in this field. If this is set to No for a field or button then it appears greyed out in the window.

Note: If you set this option to No for a check box then the check box will still appear in white on the window. To grey out a check box you must set the Enabled option to No.

Update Allowed ~~~~~~~~~~~~Specifies whether the user can enter information in the field and save it tothe database. If this is set to No, the user can enter information but cannot save it.

Prompt Text ~~~~~~~~~Defines what text is displayed with the field. It also defines the text displayed for a group of check boxes. You enter text labels for individual check boxes using the Label property (see below).

Prompt Display Style ~~~~~~~~~~~~~~~~Specifies where a prompt is displayed for multi-row columns. 'First Record' will display a prompt next to the first row. 'All Records' will display a prompt next to each row. 'Hidden' will hide all prompts.

Prompt Text Alignment ~~~~~~~~~~~~~~~~~~Specifies the alignment of the prompt text as Center, Left, Right, End, or Start within the prompt 'box'. Generally has no visible effect.

Prompt Edge ~~~~~~~~~~Specifies which edge of the field the prompt is attached to, either Start, End, Top, or Bottom.

Prompt Edge Alignment ~~~~~~~~~~~~~~~~~~~Specifies how the prompt is aligned along the selected field edge, either Start, End or Center.

Prompt Edge Offset

Page 11: Forms Configurator Setup

~~~~~~~~~~~~~~~Specifies the distance between the field and its prompt, measured in inches.

Prompt Alignment Offset ~~~~~~~~~~~~~~~~~~~Use this property to adjust the prompt edge alignment. For example, if the Prompt Edge is Top, the Prompt Edge Alignment is Center and the Prompt Alignment Offset is 0.1, the prompt will be centered 0.1 inches from the center of the top edge of the field.

Label ~~~~This only applies to buttons or check box items. The label describes the button or individual check box.

You can define an access key (or keyboard shortcut) by preceding the appropriate letter in the label with an ampersand (&). For example, to use ALT+P (in the Microsoft Windows environment) as the access key for thePicture window, enter the label &Picture.

Do not use the following letters since they are used on the Oracle Applications menu: A, E, F, G, H, Q, S, W. There is no validation to preventthe same letter being used more than once in the same window.

Tooltip Text You can enter text here that displays when the user has the mouse pointer over the field. Use this to provide additional quick help.

Previous Item ~~~~~~~~~~~Specifies which field will be tabbed to next if you tab backwards. This overrides the default tabbing order.

Next Item ~~~~~~~Specifies which field will be tabbed to next. This overrides the default tabbing order.

Default Value ~~~~~~~~~~You can set the default value for the field here. Setting defaults can help save time, provide better control, and reduce errors for the user.

Format Mask ~~~~~~~~~~You can apply a format style to number and date type fields so that the format is correct for your users.

Validation Formula ~~~~~~~~~~~~~~You can set up additional validation using formulas. For example, if you need to validate that an entry has been entered correctly, you can create a validation formula to check the format. Up to five inputs can be passed to the formula but only one message can be returned.

Formula Parameters 1-5

Page 12: Forms Configurator Setup

~~~~~~~~~~~~~~~~~~~Enter the parameters you want to pass to the formula specified in the Validation Formula field.

Information Formula ~~~~~~~~~~~~~~~You can set up additional information for fields using a formula. For example, on the Job field, the user can right click and choose More Information to see related information such as Grade and Position. Up to five inputs can be passed to the formula but only three outputs can be returned.

Information Prompt ~~~~~~~~~~~~~~~Specifies the prompt displayed on the right mouse menu which the user willselect to view the information you have defined in the Information Formula.

Formula Parameters (1-5)~~~~~~~~~~~~~~~~~~~~Enter the parameters you want to pass to the formula specified in the Information Formula field.

Alignment ~~~~~~~~Defines the alignment of text within the item (left, center, or right).

Case Restriction ~~~~~~~~~~~~~Defines what case the text will be defaulted to. For example, you can set it to upper case so that all the text entered in the field is upper case.

Bevel ~~~~Specifies the appearance of the field border, either RAISED, LOWERED, INSET, OUTSET, or NONE.

Further Information ~~~~~~~~~~~~~~~Opens the developer descriptive flexfield, where you can enter additional configuration options.

For example, for the People Management templates, you can select whether DateTrack History is enabled for datetracked fields.

Page 13: Forms Configurator Setup

Understanding and Using Custom Library in Oracle HRMS [ID 73505.1]

Modified 09-MAY-2011 Type BULLETIN Status PUBLISHED

Checked for relevance on 7-Dec-2009

***Checked for relevance on 09-MAY-2011***

PURPOSE-------

To explain how to tailor the Oracle HRMS Application using the custom library. SCOPE & APPLICATION-------------------

This document explains with the help of examples how the custom library might be used to add user defined business rules to the standard HRMS application.

CONTENT-------

1. Description2. Advantages3. Disadvantages4. Implementing Custom Logic 4.1 CUSTOM Procedure 4.2 Calling oher libraries5. Zooms6. Other Event Calls7. Support/Upgrades8. Examples9. Problems

1. Description--------------

The custom library is called by each form in the Oracle Applications product set and allows additional logic to be added without modifying the standard code. It is a generic feature and not specific to HRMS. Therefore, careful consideration needs to be given to the coding standards applied, particularly if more than one product is affected.

The custom library can be used to add zooms, enforce additional business rules, change properties of fields as an example, hide,disable,highlight, and call PL/SQL server side packages. Examples of all of these will be included in later sections.

Page 14: Forms Configurator Setup

2. Advantages-------------

The main advantage of custom library has already been mentioned. That its allows customization without modification of standard code. It can be easily decoupled for some users, and the custom code can easily be saved, and re-implemented during upgrades.

It's potential can be extended even further in HRMS by using it in conjunction with calls to Formula, PL/SQL routines, and API User Hooks.

3. Disadvantages----------------

The custom library can only be used in conjunction with the forms interface.Anyone that needs to implement a customization to be used by other interfaces, such as batch or self service might consider using API User Hooks or Workflow.

The generic event points are limited, and although HRMS Development have added additional event points, these haven't yet been implemented in all forms.

There is a sizing limitation to the custom library, and as the same library is used across products, careful consideration must be given to the design and construct. It makes sense to partition code further in multiple libraries by product code, and even form. However, there may well be a cost involved in terms of performance.

4. Implementing Custom Logic----------------------------

The custom library is a file called Custom.pll which resides in the directory $AU_TOP/resource directory. This is equivalent to AU10\RES\PLSQL for Smart Client. The compiled version is Custom.plx.

4.1 CUSTOM Procedure--------------------

This library contains a PL/SQL package called CUSTOM where customizations are added. The specification of the package cannot be changed in any way.Packages can be added but these should be sequenced after CUSTOM by naming them after C in the alphabet. Fig 1 shows the skeleton layout of the CUSTOM package.

Fig 1.------

PACKAGE custom IS

function zoom_available return BOOLEAN; function style(event_name varchar2) return integer; procedure event(event_name varchar2); before constant integer := 1; after constant integer := 2; override constant integer := 3; standard constant integer := 4;

END custom;

Page 15: Forms Configurator Setup

package body custom is function zoom_available return boolean is begin return FALSE; end zoom_available; -------------------------------------------------------------------- function style(event_name varchar2) return integer is begin return custom.standard; end style; -------------------------------------------------------------------- procedure event(event_name varchar2) is begin null; end event; end custom;

Modifications to the CUSTOM package are made using the Forms Designer. It maymake sense to take several copies at each stage of the design and build to fallback on. Afterwards compile and then generate a new .plx using Forms Generate.

4.2 Calling other Libraries---------------------------

All of the examples in this document will show the CUSTOM procedure checking fora form name and then calling a separate library beginning USER_

. Thereasons for this have already been mentioned. The easiest way of creating aseparate library, and modifying custom.pll to call it is as follows:

a) Copy custom.pll to user_.pll

b) Start Forms Designer.

c) Connect to database and open the new library. d) Open up Libraries menu, then CUSTOM, then Program Units.

e) Double click on the CUSTOM (Package Spec)and change the name in PACKAGE and END statements as appropriate.

f) Compile and close.

g) Double click on CUSTOM (Package Body), change name in PACKAGE and END statements as appropriate, and add events to the event procedure as

Page 16: Forms Configurator Setup

required.

h) Compile and close, then save changes.

i) Open custom.pll

j) Open up libraries menu, then CUSTOM, then Attached Libraries.

k) Click on Create Icon from toolbar, pick in new library and click on Attach button.

l) Open up Libraries menu, then CUSTOM, then Program Units.

m) Double click on CUSTOM (Package Body), and add the code to the event procedure to call the new library. For instance:

form_name varchar2(30) := name_in('system.current_form'); begin

if form_name = 'PAYGBSOE' then user_paygbsoe.event(event_name); else null;

n) Compile and close, then save changes.

o) Both libraries now need generating using the Forms Generate.

5. Zooms--------

The Zoom is a special type of event that can be used to open another form,or present user with a simple message dialogue box . There are two areas inthe CUSTOM package that need to be modified to enable a Zoom:

a) Add a branch to the CUSTOM.ZOOM_AVAILABLE function to specify the form from which the Zoom is invoked. This effectively lights up the Icon on the Applications toolbar. For instance

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 = 'DEMXXEOR' and block_name = 'ORDERS') then return TRUE; else return FALSE; end if; end zoom_available;

b) Add a branch to the CUSTOM.EVENT procedure for the Zoom Event. For instance, procedure event(event_name varchar2) is form_name varchar2(30) := name_in('system.current_form'); block_name varchar2(30) := name_in('system.cursor_block');

Page 17: Forms Configurator Setup

begin if (event_name = 'ZOOM') then if (form_name = 'DEMXXEOR' and block_name = 'ORDERS') then

...... ......

If partitioning code as described in 4.2, the zoom function can be modified inthe CUSTOM package, and the event added to the form library.

6. Other Event Calls--------------------

The custom library receives two kinds of event calls, generic and productspecific. Generic events can be used by all forms in Oracle Applications. Product specific events are specific to individual applications.

Generic custom library events include:

WHEN-NEW-FORM-INSTANCEWHEN-NEW-RECORD-INSTANCEWHEN-VALIDATE-RECORDWHEN-NEW-BLOCK-INSTANCEWHEN-NEW-ITEM-INSTANCEZOOMEXPORT

HRMS specific event points include:

WHEN-CREATE-RECORDPRE-INSERTPOST-DELETEWHEN-FORM-NAVIGATEPOST-QUERYPRE-DELETEPOST-FORMS-COMMITWHEN-BUTTON-PRESSEDKEY-DELRECPOST-UPDATEPRE-UPDATEPOST-INSERTSPECIALnNAVIGATE

Note: These event points have not yet, at the time of writing, been added to all HRMS forms, but a gradual implementation is under way.

A common requirement of a custom library event is to modify an item in a formblock. For instance, to force data in a field to be entered in UPPER case only,or to highlight a mandatory field. In custom library you must use the OracleForms built-in routine SET_ITEM_PROPERTY to achieve this. For example, the following code shows how to highlight a field:

procedure event(event_name varchar2) is

Page 18: Forms Configurator Setup

begin if event_name = 'WHEN-NEW-FORM-INSTANCE' then set_item_property('hou1.location_code',VISUAL_ATTRIBUTE,'SELECTED_DATA'); end if; end event;

7. Support and Upgrades-----------------------

The Custom Library can be switched off in a forms session by selectingHelp -> Tools -> Custom Code -> Off from the menu bar. This is importantfrom a support point of view if an analyst is trying to isolate an errorin the system. If it transpires that the error is being raised by a branchto the Custom Library, then that would not normally be supported by theApplication product support groups who only support the standard product.

Before upgrading it would be necessary to take a copy of the custom libraryand any user libraries or PL/SQL called by the custom library. These can becopied back to the $AU_TOP/resource directory after the upgrade, and as thelibrary is a runtime library, the user code will be available immediately. Aswith any upgrade, however, there may be changes to the product schema which could also affect any customizations made using custom library.

8. Examples-----------

Fig 2 shows a version of the CUSTOM package with two zooms enabled andsome branches to other user libraries.

Fig 2.------

package body custom is

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 in ('PAYGBSOE','PAYWSMEE') then return TRUE; else return FALSE; end if; end zoom_available; -------------------------------------------------------------------- function style(event_name varchar2) return integer is begin return custom.standard; end style; --------------------------------------------------------------------

Page 19: Forms Configurator Setup

procedure event(event_name varchar2) is

form_name varchar2(30) := name_in('system.current_form');begin

if form_name = 'PAYGBSOE' then user_paygbsoe.event(event_name); elsif form_name = 'PAYWSMEE' then user_paywsmee.event(event_name); elsif form_name = 'PERWSEPI' then user_perwsepi.event(event_name); elsif form_name = 'PERWSDOR' then user_perwsdor.event(event_name); elsif form_name = 'PERWSEAD' then user_perwsead.event(event_name); else null;end if;end event; end custom;

EXAMPLE 1---------

Examples 1 and 2 are taken from the Euro Examples White Paper. In both casesa message dialogue box is opened and a message displayed using the LPADfunction. You will need to set an exchange rate of GBP to EURO, and assigna default payroll using the profile option,HR:Default Payroll for CurrencyConversion. The zooms call the hr_currency_pkg seeded package PL/SQL package.

package body User_Paygbsoe is

procedure event(event_name varchar2) is l_message_string varchar2(2000) ;form_name varchar2(30) := name_in('system.current_form');block_name varchar2(30) := name_in('system.cursor_block');curr_code VARCHAR2(3);total_payment NUMBER;total_deductions NUMBER;amount_paid NUMBER;ele_entry_name VARCHAR2(30);ele_entry_value NUMBER;beginif (event_name = 'ZOOM') then if (form_name = 'PAYGBSOE') then

curr_code := name_in('CTL_GLOBALS.BG_CURRENCY_CODE');ele_entry_value := name_in('BALANCE.BALANCE_VALUE');ele_entry_name := name_in('BALANCE.BALANCE_NAME');total_deductions := name_in('PAY_ASS.TOTAL_DEDUCT');total_payment := name_in('PAY_ASS.TOTAL_PAYMENT');

Page 20: Forms Configurator Setup

amount_paid := name_in('PAY_ASS.AMOUNT_PAID');

l_message_string := ' European Currency Converter' || CHR(10) || CHR(13) ||CHR(10) || CHR(13) ||LPAD(curr_code,48) || LPAD('EUR',14) || CHR(10) || CHR(13) ||LPAD('Total Payments:',17) ||LPAD(TO_CHAR(total_payment, FND_CURRENCY.GET_FORMAT_MASK(curr_code, 12)),12) ||LPAD(TO_CHAR(hr_currency_pkg.convert_amount(curr_code,'EUR', TRUNC(sysdate), total_payment, NULL),FND_CURRENCY.GET_FORMAT_MASK('EUR', 12)),12) || CHR(10) || CHR(13) ||LPAD('Total Deductions:',17) ||LPAD(TO_CHAR(total_deductions,FND_CURRENCY.GET_FORMAT_MASK(curr_code, 12)),12) ||LPAD(TO_CHAR(hr_currency_pkg.convert_amount(curr_code,'EUR', TRUNC(sysdate), total_deductions, NULL),FND_CURRENCY.GET_FORMAT_MASK('EUR', 12)),12) || CHR(10) || CHR(13) ||LPAD(' ',40) || '----------- -----------' || CHR(10) || CHR(13) ||LPAD('Amount Paid:',20) ||LPAD(TO_CHAR(amount_paid, FND_CURRENCY.GET_FORMAT_MASK(curr_code, 12)),12) ||LPAD(TO_CHAR(hr_currency_pkg.convert_amount(curr_code,'EUR', TRUNC(sysdate), amount_paid, NULL),FND_CURRENCY.GET_FORMAT_MASK('EUR', 12)),12) || CHR(10) || CHR(13) ||CHR(10) || CHR(13) ||LPAD(ele_entry_name,20) || ':' ||LPAD(TO_CHAR(ele_entry_value,FND_CURRENCY.GET_FORMAT_MASK(curr_code, 12)),12) ||LPAD(TO_CHAR(hr_currency_pkg.convert_amount(curr_code,'EUR', TRUNC(sysdate), ele_entry_value, NULL),FND_CURRENCY.GET_FORMAT_MASK('EUR', 12)),12) || CHR(10) || CHR(13);fnd_message.set_string(l_message_string);fnd_message.show ;end if;end if;end event; end User_Paygbsoe;

EXAMPLE 2---------

package body user_paywsmee is

procedure event(event_name varchar2) is l_message_string varchar2(2000) ;form_name varchar2(30) := name_in('system.current_form');block_name varchar2(30) := name_in('system.cursor_block');curr_code varchar2(3) ;ele_entry_uom varchar2(30);ele_entry_name varchar2(30);ele_entry_value number;beginif ( event_name = 'ZOOM' ) then

Page 21: Forms Configurator Setup

if (form_name = 'PAYWSMEE' and block_name = 'ENTRY') thencurr_code := name_in('ENTRY.INPUT_CURRENCY_CODE');l_message_string := ' European Currency Converter' ||CHR(10) || CHR(13) ||CHR(10) || CHR(13) ||LPAD(curr_code,48)||LPAD('EUR',14)||CHR(10)||CHR(13);FOR p_index IN 1..15 LOOPele_entry_uom := name_in('ENTRY.UOM'||TO_CHAR(p_index));IF ele_entry_uom = 'M' thenele_entry_name:= name_in('ENTRY.NAME'||TO_CHAR(p_index));ele_entry_value:= name_in('ENTRY.USER_ENTRY'||TO_CHAR(p_index));l_message_string := l_message_string ||LPAD(ele_entry_name,20)||':'||LPAD(TO_CHAR(ele_entry_value,FND_CURRENCY.GET_FORMAT_MASK(curr_code, 12)),12)||LPAD(TO_CHAR(hr_currency_pkg.convert_amount(curr_code,'EUR', TRUNC(sysdate), ele_entry_value, NULL),FND_CURRENCY.GET_FORMAT_MASK('EUR', 12)),12)||CHR(10)||CHR(13);END IF;END LOOP;fnd_message.set_string(l_message_string);fnd_message.show ;end if;end if;end event;end user_paywsmee;

EXAMPLE 3---------

This example illustrates how to modify item properties. The first two functioncalls show how to grey out, and disable a field. The third removes a field, butat the time of writing it is not possible to remove the prompt. The Fourth callforces data entry in upper case for a specified field.

package body user_perwsepi is procedure event(event_name varchar2) is beginif event_name = 'WHEN-NEW-FORM-INSTANCE' then-- The first line protects the field against entry, and the second line-- greys it out. set_item_property('person.pre_name_adjunct',ENTERABLE_PLUS,PROPERTY_OFF); set_item_property('person.pre_name_adjunct',VISUAL_ATTRIBUTE,'DEFAULT');-- This hides the Mail To field set_item_property('person.d_home_office',DISPLAYED,PROPERTY_OFF);-- Force Middle Name into Upper Case set_item_property('person.middle_names',CASE_RESTRICTION,UPPERCASE);end if;end event; end user_perwsepi;

EXAMPLE 4---------

Page 22: Forms Configurator Setup

This example asks for a user response to a question, and then acts on thatresponse. If the user replies in the affirmative to the question to makethe field mandatory, the fields are highlighted and then prior to commitchecked for null values. If no entry has been made, an appropriate message isdisplayed. package body user_perwsdor is

l_button_selected number default 1; procedure event(event_name varchar2) is beginif event_name = 'WHEN-NEW-FORM-INSTANCE' then fnd_message.set_string('Would you like to make Location a mandatory field? ');l_button_selected:=fnd_message.question(button1 => 'Cancel',

button2 => 'No', button3 => 'Yes',

default_btn => 2, cancel_btn => 1,

icon => 'question');fnd_message.show;

if l_button_selected = 3 then set_item_property('hou1.location_code',VISUAL_ATTRIBUTE,'SELECTED_DATA'); set_item_property('hou1.d_location_address', VISUAL_ATTRIBUTE,'SELECTED_DATA'); copy('Y','global.check_highlight_flds'); elsif l_button_selected = 2 then copy('N','global.check_highlight_flds'); else copy('N','global.check_highlight_flds'); end if;

end if;

if event_name in ('POST-INSERT','POST-UPDATE') then if name_in('global.check_highlight_flds') = 'Y' then if name_in('hou1.location_code') is null then fnd_message.set_string ('You have not entered the Location details');

fnd_message.show; raise form_trigger_failure; end if; end if;end if;end event;end user_perwsdor;

EXAMPLE 5---------

This example includes a call to a server side package to retrieve a countand then copies it to a descriptive flexfield segment for saving to the database.

Page 23: Forms Configurator Setup

package body user_perwsead is

block_name varchar2(30) := name_in('system.current_block');

l_year number;l_start_of_tax_year date;l_absence_days number; procedure event(event_name varchar2) is begin

Note: This event point is the only suitable event point in this form at present.The HRMS specific event points hadn't been added at the time of writing. Theresult of this is that the total in this example only includes committed recordsto the database. To include the record currently being inserted, force a secondcommit in the form. An alternative method would be to add the value ofaba.absence_days to l_absence_days before copying to attribute10, but thiswould increment everytime an absence was queried and updated.

if block_name = 'ABA' then if event_name in ('WHEN-VALIDATE-RECORD') then if (name_in('aba.date_end') is not null and name_in('aba.c_type_desc') = 'Holidays') then user_cuslib.rolling_uk_holidays (p_person_id => to_number(name_in('aba.person_id')), p_abs_actual_end_date => to_date(name_in('aba.date_end'),'DD-MON-YYYY'), p_abs_att_id => to_number(name_in('aba.absence_attendance_type_id')), p_absence_days => l_absence_days); copy (to_char(l_absence_days),'aba.attribute10'); end if; end if;end if;end event;end user_perwsead;

Server Side Package-------------------

package user_cuslib asprocedure rolling_uk_holidays (p_person_id in number, p_abs_actual_end_date in date, p_abs_att_id in number, p_absence_days out number);end user_cuslib;package body user_cuslib asprocedure rolling_uk_holidays (p_person_id in number, p_abs_actual_end_date in date, p_abs_att_id in number, p_absence_days out number)isl_start_of_tax_year date;l_year number(4);

Page 24: Forms Configurator Setup

cursor c_calc_abs_total is select sum(nvl(paa.absence_days,0)) abs_tot_days from per_absence_attendances paa where paa.absence_attendance_type_id = p_abs_att_id and paa.person_id = p_person_id and paa.date_end between l_start_of_tax_year and p_abs_actual_end_date;beginl_year := to_number(to_char(p_abs_actual_end_date,'YYYY'));if to_char(p_abs_actual_end_date,'MON') in ('JAN','FEB','MAR') then l_start_of_tax_year := to_date('01-APR-'||(l_year-1),'DD-MON-YYYY'); else l_start_of_tax_year := to_date('01-APR-'||(l_year),'DD-MON-YYYY');end if;open c_calc_abs_total;fetch c_calc_abs_total into p_absence_days;close c_calc_abs_total;end rolling_uk_holidays;end user_cuslib;

9. Problems-----------

Custom library is a very powerful tool and can lead to problems if mismanaged.

One problem where the ADE icon on the toolbar didn't respond when the user clicked on it was eventually traced to the custom library. Someone had copied apackage from the HR_GEN.pll library into the Custom.pll library and then commented out all the lines. The package was HR_FORM, and as the Custom Libraryis read into memory after the HR_GEN library, the result was to overwrite the seeded package.

Please also remember that if planning to add a custom event to the assignmentform that it has to reference the Enter and Maintain Person (PERWSHRG), andthe Fastpath Assignment (PERWSEMA) forms.

________________________________________________________________________________ Oracle Support Services


Related Documents