11 i 10 at Form Personalization

Post on 02-Jan-2016

122 views 7 download

Tags:

Transcript of 11 i 10 at Form Personalization

Form Personalization

Agenda

Customer Forms Personalization presentation

Forms Personalization form high level overview

Forms Personalization expressions and sample message generation

Demo scenarios and look behind the scenes

Goal:

Provide introduction, background, and working example takeaways to use as models for your own situations.

For Business User Presentation…

All customers desire to: Remove fields, buttons, tabs, etc. from the screen because

they never use them Re-label fields, buttons, tips to match their terminology Change the default value of fields Allow easy access from one form to another, passing context Add additional business logic/practices/messages Do any of the above for only a particular user or

responsibility Do any of the above only if certain conditions are true. Do all of the above in a upgradeable manner without writing

code, and without violating Support agreements

Major Business Benefits

• Change the product to match your business processes, not vice versa

• Implement your Security, your Navigation, your Defaults, your Terminology…

• Changes can be built, tested and deployed in minutes• Most changes can be entered by functional experts, not

technical experts• Multi-Language: Every Action can be associated with

one language, or all languages.• Changes are not customizations to standard Oracle

forms code• Upgradeable (but they do need to be tested)

Support of additional business

logic/practices (e.g. Hold

Order)

Form Personalization Example:

Create pop-up messages generated

for/with specific conditions and/or

data

Modify prompt/field title, remove fields, change entry order. Change default

values, auto-fill or validate data based on business rules,

make fields mandatory

Add menu items, and shortcuts to

other forms/URLs, with data/parameter

passing

Add/enable icons

For IT/Technical Presentation…

Overview of Form Personalization

• Allows you to make declarative changes to a form (not changes to code)

• Changes are applied at runtime when the proper trigger event (e.g. field to field navigation) occurs.

• Change object properties (e.g. name/title)• Display messages to user• Activate additional menu entries • Execute certain Forms builtins (e.g. database

procedure call, ‘Do’ key, open form/URL)• Based on definable Conditions• For a Site, Responsibility, Industry, or User

You don’t have to think like a developer – Objects with prompts, titles or labels can be selected by their current on-screen

text

But, textual values and conditions offer powerful capabilities if you do want to think like a developer

– :block.fields (current form and system values)– SQL functions/procedures– server-side functions– SELECT statements

All changes can be ‘Applied’ or ‘Validated’ immediately to see their effect All changes can be disabled at multiple levels

– All, Rule, or Action

The UI Personalization Experience

For Existing Customer Presentation….

Relationship to CUSTOM.PLL library

CUSTOM.PLL is a stub library Oracle ships that receives certain form events. Customers are able to freely add any code they like to it.

– It is an Oracle Forms library, so you must use Oracle Developer to edit and generate it

CUSTOM .PLL can do more because it has complete access to all PL/SQL and SQL

But Form Personalization can probably handle the vast majority of your changes.

Form Personalizations, and changes to the CUSTOM .PLL library, can co-exist

‘Validate All’ will test the existence of all object references in your Personalizations after applying a patch (but no substitute for regression testing).

Available as part of the FND 11.5.10 minipack, patch 3262159

Separate APPCORE rollup patch 3358850 shortly after the release of 11.5.10 (since it contains a significant amount of code from the FND 11.5.10 minipack, and we strongly encourage you to consider the minipack instead.)

FAQs

Forms Personalization Form Overview

Value field options (Properties/Messages)

Hi there World!Constant:

='Hi there '||:po_headers.vendor_nameExpression:

=SOME_DATABASE_FUNCTION(:po_headers.vendor_id )

Expression (DB function):

=SELECT vendor_name "A" from po_vendors where vendor_id = :po_headers.vendor_id

SQL Statement:

Note: 2000 character limit (text length and return value)!

PO_HEADERS.VENDOR_SITE_CODE

Scenario:Display some messages when the Supplier is entered:

(‘Hi There’, Vendor_ID, and # Open AP invoices)

Note: Column alias of “A”

Navigating Form to Form (Zoom)

Navigating Form to Form (Zoom)

‘Sending Form’ and ‘Receiving Form’

Parameter passing not necessary (but nice)– Sending form sets variable/parameter to pass

– Receiving form gets variables/parameter

SPECIAL menus– Special1 – Special15 – ‘Tools’ Menu

– Special16 – Special30 – ‘Reports’ Menu

– Special31 – Special45 – ‘Actions’ Menu

Zoom icon/button ( ) – R.I.P.

Receiving Form parameter passing Options

1. Form-coded Parameter (un-documented):– Calling form passes right parameter(s)/value(s)

2. Query By Example (QBE):– Query Enter, set value, clear variable, Do query

3. Find Screen:– Go to Find Block, set value, clear variable, Next

Block, Clear fields on Find block

4. Default WHERE clause for block:– Set WHERE clause block, clear variable, execute

query, reset WHERE clause

Abbreviations

WNFIWHEN-NEW-FORM-INSTANCE

WNII WHEN-NEW-ITEM-INSTANCE

WNBI WHEN-NEW-BLOCK-INSTANCE

WNRI WHEN-NEW-RECORD-INSTANCE

WVR WHEN-VALIDATE-RECORD

Sending Form – Parameter passing Process Details

1. WNFI: A. Enable Tools/Action/Reports menu option (and

optional icon) for desired block(s)

2. SPECIALnn: A. Save form field(s) to be passed in Global variable(s)

B. Builtin FND_FUNCTION.EXECUTE (form) or FND_UTILITIES.OPEN_URL (web)

Hint: Test process manually to insure that it works

Receiving Form – Parameter passing Process Details

1. WNFI: Set “Initial Value” for Global variable(s) (prevents errors if Global variable does not exist during condition test)

2. WNRI: If Global variable has value (initiate query):A. (QBE or WHERE Clause): Do_Key Enter_Query

or

B. (Find Form): Go_Block find_block_name (unless form automatically starts in Find Screen/Block)

Receiving Form – Parameter passing Process Details

3. WNRI: If Global variable has value (and in ‘Enter-Query’ Mode for QBE or WHERE Clause):

QBEa. Set search field(s)

from global variable(s)

b. Clear global variables to prevent re-fire

c. Initiate Search Execute_Query

Find Forma. Set search field(s)

from global variable(s)

b. Clear global variables to prevent re-fire

c. Initiate Search Next_Block

d. Clear Find Block fields(s)

Hint: Test process manually to insure that it works

Default WHEREa. Set block WHERE

clause from global variable(s)

b. Clear global variables to prevent re-fire

c. Initiate Search Execute_Query

d. Reset WHERE clause

Real Demo Experience #1

Requirement:Zoom to Supplier screen for selected

Supplier

Behind the Scenes (Sending Form):AP Invoice Form Personalizations

1. Add the ‘View Supplier’ Option

2. Execute code when ‘View Supplier’ Option (Special45) selectedA. Save Vendor Name

B. Open Supplier Form

Note: No ‘.gif’ in icon name. Icon needs to reside in ‘http://laXXXX.oracleads.com/OA_JAVA/oracle/apps/media/’. See Presenter’s notes at end of presentation for HTML to view standard icons and names in directory (over 6100 gif files!).

Bug/Anomaly: When searching for a Function Name, use ‘%’ to display all functions and then refine search with function name (e.g. ‘%Suppl%’)

Behind the Scenes (Receiving Form) Supplier Form Personalizations: QBE

1. Initialize global variables (just in case they don’t exist)

2. If global variable is not null go into Query By Example mode (QBE)

3. If global variable is set and in QBE, set search field, clear global variable, execute query

VNDR.VENDOR_NAME

INITIAL VALUE: Create the Global if it doesn’t exist, but leave current value alone if it does exist.

Same problem, different approach..

Behind the Scenes (Receiving Form) Supplier Form Personalizations utilizing

the Find Form instead of QBE

Behind the Scenes (Receiving Form) Supplier Form Personalizations: Find Form

1. Initialize global variables (just in case they don’t exist)

2. If global variable is not null go to Find Block

3. If global variable is not null and in Find Block set search field, clear global variable, do Next_Block, clear Fields on Find Block

VNDR_QF.VENDOR_NAME

Find Form sets the vendor number once the vendor name is set, so need to clear both!

Real Demo Experience #2

Requirement:Task Type determines task Owner (and Owner Type)

WNII EventWNII Event

WNII Event

WNII Event

WNII Event

No Event!

Changed the Tab order with Forms Personalizations

Problem (and Solution)

Forms Personalizations then populates these

based on Problem type

Behind the Scenes:Interaction Wrap-up Form Personalizations

1. Set Navigation Order

2. If in Description fieldA. Set Owner Type (screen value and code)

B. Set Owner (screen value and ID)

C. Set Owner valid (as if user navigated through field)

Fake Demo Experience #3

Requirement:Prevent access to the

‘Bank Accounts’ tab for the user ‘MFG’

Behind the Scenes:Customers Form Personalization

1. WNBI @CUST_BANK block for User MFG:A. Builtin Go_Block, CUST_PAYMETH

You can apply the same concept to prevent update to a field (but have the contents still visible):

WNII@field, use Builtin Go_Item to go to next field

(the ‘Alterable’ property might also work)

To hide a field, set Property “Displayed” = False

FORMS_DDL Builtin

FORMS_DDL Builtin

FORMS_DDL Built in allows execution of a PL/SQL block:

– 2000 characters or less– Difficult to pass parameters in, no bind variables,

so must create a single concatenated string for statement that will be executed: FORMS_DDL( 'Begin

Update_Employee('||TO_CHAR(:emp.empno) ||');

End; ' );– No way to get return value/status out, but there

are ways….

Real Demo Experience #4

Requirement:Place line on hold if

margin goes below 30%

procedure hrd_add_order_hold(i_HOLD_ID number,i_HOLD_ENTITY varchar2 -- (O=Order, I=Item ),i_HOLD_ENTITY_id1 number -- (O=header_id , I=Inventory_item_id),i_HOLD_COMMENT varchar2 default null,i_header_id number -- Order header id,i_line_id number default null ) -- line id

Note: Building a string to execute requires use of || to

include form/global variables and '' around the constant for

the Hold Comment

FORMS_DDL passing parameters

In:– Form/Global variables need to be concatenated into

string that will be executed by FORMS_DDL. Watch constants that need to be surrounded by single quotes

Out:– Results of PL/SQL block can be pushed onto a virtual

stack within PL/SQL block– Results can then be pulled off virtual stack in

additional/next Action step– HRD_STACK code for manipulating a private virtual

stack is in presentation notes on another slide

Db Function or stored procedure with ‘OUT’ parameters i.e.:

stored_procedure(v_in ,v_results)

hrd_stack_push(token,value) places value on a virtual stack

labeled with token name

Note: Building a string to execute requires use of || to

include form/global variables and '' around token constant

RESULTS in hrd_stack_push()

hrd_stack_pull(token) pulls the value from a virtual stack labeled with token name

(or returns null if doesn’t exist)

Stack Manipulation Functions/Procedures:

HRD_STACK_PUSH ( token name, value ) – Pushes value on stack under token name

HRD_STACK_PUSH_F ( token name, value ) – Same as above, but a function (returns varchar2) instead of a stored procedure (can be used in SELECT statement)

HRD_STACK_PULL ( token name ) – Function that returns value (or null) stored on stack under token name and removes value from the stack (destructive)

HRD_STACK_PEEK ( token name ) – Function that returns value (or null) stored under token name BUT KEEPS value on the stack (non-destructive) (Used for testing for a value still keeping it available for use.)

HRD_STACK_PURGE – Purges contents of stack for user Code is in Speaker Notes for this slide

HRD_STACK – How it works

Creates a custom table HRD_STACK to store user ID (unique ID per user and session), token name, and value

Token/value pairs are stored or read/deleted in table under autonomous transactions (commits are independent of calling procedures)

Function form of HRD_STACK_PUSH (HRD_STACK_PUSH_F) useful for placing values on the stack with SELECT statements:

– SELECT hrd_stack_push_f(‘TEST_VALUE’,100) from dual;

Usage Examples: STACK_PUSH

A: begin

HRD_STACK_PUSH(‘CUST_NUM’,123);

end;

B: select HRD_STACK_PUSH_F(‘CUST_NUM’, 123)

from dual;

Usage Example: STACK_PULL and STACK_PEEK

A: v_customer := HRD_STACK_PULL(‘CUST_NUM’);

B: select HRD_STACK_PULL(‘CUST_NUM’) from dual;

C: if HRD_STACK_PEEK(‘CUST_NUM’) is not null then

v_customer := HRD_STACK_PULL(‘CUST_NUM’);

end if;

Real Demo Experience #5

Requirement:If the item cannot be shipped to a specific state (hazardous materials), or if the Rep is not authorized to sell the item, place the line item on hold (and warn user)

Behind the Scenes:Order Form Personalization

1. WNII @Quantity and Qty is null:A. Check Restrictions

i. Check Restrictions for item and rep, if either exists place line on hold, create attachment (item only)

ii. Get item message into Item message variable

iii. Get rep message into Rep message variable

B. If Item Restriction variable is not null, display returned message, clear item message

C. If Rep Restriction, variable is not null, display returned message, clear rep message

Two stored procedures hrd_restricted_item and

hrd_restricted_rep checks restrictions, generates

appropriate message text and places order on hold

Stack procedure hrd_stack_push

pushes messages onto stack for later retrieval

HRD_RESTRICTED_ITEM Functioncreate or replace function hrd_restricted_item( … ) return varchar2 as …begin… select count(*) into v_count from MTL_ITEM_CATEGORIES_V where … if v_count <> 0 then v_message := 'Due to EPA Regulations, this item cannot be shipped to the state of '

||v_state||'. This line will be placed on HOLD.'; … hrd_add_attachment( … ); hrd_add_order_hold( … ); end if; return(v_message);end;/

Performance tip: include a‘and rownum = 1’ in WHERE clause

Stack procedure hrd_stack_push

pushes messages onto stack for later retrieval

Oops……

Restrictions Checks are done as long as the Quantity field is null. What if the item is changed after the quantity has been entered?

Each time user returns to Quantity field (as long as it is blank) the Restrictions Checks are performed (and the messages displayed)

Since the Restrictions Checks add Order Holds and Attachments to the order, multiple Order Holds and multiple Attachments will be created!

Only want check a if new line or item changed!

Behind the Scenes:Order Form Personalization - Tweak

1. WNII @Quantity and nvl(ATTRIBUTE11,' ')<>itemA. Check Restrictions

i. Check Restrictions for item and rep, if either exists place line on hold, create attachment (item only)

ii. Get item message

iii. Get rep message

iv. Set ATTRIBUTE11 = item Number *

B. If Item Restriction variable is not null, display returned message, clear item message

C. If Rep Restriction, variable is not null, display returned message, clear rep message

* Objections from the Flexfield Development Team noted.

Miscellaneous Stuff

Personalizations are made per function, not form. This means that in MFG and CRM where a few forms can launch with seemingly dozens of different functions, personalizations might need to be replicated. 

Make sure 'Close Other Forms' is unchecked in the Navigator form so the Personalization form doesn't keep closing as you test your changes.

Real numbers should be entered with decimal point as the radix (canonical format), regardless of current NLS settings.

If you hide a Tab page, you may need to change the navigation sequence of items before and after it to prevent it from popping open. 

Use the message type of 'Debug' to help you resolve issues.  The context of 'Industry' is reserved for future use

Why a personalization might not run:

The Rule or Action is not enabled The Condition you entered for the Rule has evaluated to FALSE The Trigger Event and/or Trigger Object were not what you expected The scope of the rule only consists of Responsibility, Industry and/or User,

and none is true for the current context. Messages of type Error, or a Warning that the user responds to with ‘No’,

raises form_trigger_failure and stops further processing.) An action is executing the Builtin 'RAISE FORM_TRIGGER_FAILURE'

which will abort all further processing for that event. The Language of the Action is different than what you are currently running You have set Custom Code to ‘Off’ or ‘Core code only’ in the pulldown

menu

Final Notes and Thoughts

Review Forms Personalization Documentation and Viewlets

– Users Guide: Metalink note 279034.1– Viewlets and Powerpoints should soon be on the 11.5.10 TOI

Center – AppsTech on Global Exchange, Forms Personalization link

(http://globalxchange.oraclecorp.com/appstech) Test manually and use ‘Show Custom Events’ to

determine what the Form is really doing (maybe not what you think!)

If you ‘break’ a form, turn off Custom Code and fix Form Personalization

The one consistency with Form coding is the inconsistency with Form coding! (especially with ‘CRM’)

Final Notes and Thoughts

Forms Personalization =

Demo PersonalizationIf the demo does not utilize Forms

Personalization in some manner, you(or the SCs) are not thinking hard enough!

THINK OUTSIDE THE BOX!

AQ&Q U E S T I O N SQ U E S T I O N SA N S W E R SA N S W E R S

The HTML attached in Presenter’s notes for this slide will display the standard icons available in the

‘http://laXXXX.oracleads.com/OA_JAVA/oracle/apps/media/’ directory. (Copy to Notepad , change instance reference in “base href” line to your instance, and save file with a .HTM extension)

Part 1 of 2 (approx 3090 icons)

The HTML attached in Presenter’s notes for this slide will display the standard icons available in the

‘http://laXXXX.oracleads.com/OA_JAVA/oracle/apps/media/’ directory. (Copy to Notepad, change instance reference in “base href” line to your instance, and save file with a .HTM extension)

Part 2 of 2 (approx 3090 icons)