support.oracle.com csp main article cmd=show&type=not&doctype=howto&id=1130255.1

3
Oracle Personalization, Execute A Procedure, Return Value To Screen? [Video] [ID 1130255.1] Modified 29-JUL-2010 Type HOWTO Status PUBLISHED In this Document Goal Solution Documentation Example Setup Steps References Applies to: Oracle Inventory Management - Version: 11.5.10 and later [Release: 11.5 and later ] Information in this document applies to any platform. Goal How does one look up values from the database and populate fields using Personalization? Solution This should be possible using Personalization with a function on the database that retrieves values based on other data entered on the screen by the user. The function then returns these with a movie viewlet recording and screen shots follows. Documentation This is a tricky area and there is not a lot of documentation on the subject. This is one good overview note about personalization though the note does not have details on this topic: Note 7 Applications. There are discussions about similar topics on external forums like this one mentioned only as a reference. Note that links change and this was valid as of June 2010. Here is technical/296-stored-procedure-form-personalization . Example Here is a simple example using a function in the database that queries values, then a personalization that sets the value queried from dual. In this example, the function is extremely simp the code entered for the personalization text entered as the value for the account. This example is defined in the miscellaneous transactions form (INVTTMTX.fmb) and passes the item nu =select JBP_TEST_f1(''||${item.MTL_TRX_LINE.ITEM.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 the callout is made to replace the value of the item before passing the text to the function. You can use similar naming for your own fields finding the name of the Block and Field using He Here is the example routine used - this just does a simple select from dual but other advanced logic could be used: create or replace function JBP_TEST_f1 (p_value in varchar2 default 'none') return varchar2 as l_return_variable varchar2(1000) := 'No Value'; begin select 'x' into l_return_variable from dual; return(p_value||'+'||l_return_variable); end; / Setup Steps Video - Viewlet recording of personalization (05:57) 1. In SQL, create the function: create or replace function JBP_TEST_f1 (p_value in varchar2 default 'none') return varchar2 as l_return_variable varchar2(1000) := 'No Value'; begin select 'x' into l_return_variable from dual; return(p_value||'+'||l_return_variable); end; / * Create the function and ensure it is valid. Here is an example SQL for checking for invalids: select object_name, object_type, owner, status from dba_objects where status = 'INVALID' order by object_name 2. Open the form that you want to personalize, then choose Help > Diagnostics > Custom Code > Personalize. In this case, the miscellaneous transactions form is opened. Rate this document

Upload: pradeepbojanala6973

Post on 05-Mar-2015

54 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Support.oracle.com CSP Main Article Cmd=Show&Type=NOT&Doctype=HOWTO&Id=1130255.1

Oracle Personalization, Execute A Procedure, Return Value To Screen? [Video] [ID 1130255.1]

Modified 29-JUL-2010 Type HOWTO Status PUBLISHED

In this Document Goal Solution Documentation Example Setup Steps References

Applies to:

Oracle Inventory Management - Version: 11.5.10 and later [Release: 11.5 and later ]Information in this document applies to any platform.

Goal

How does one look up values from the database and populate fields using Personalization?

Solution

This should be possible using Personalization with a function on the database that retrieves values based on other data entered on the screen by the user. The function then returns these values to a field on the screen. An examplewith a movie viewlet recording and screen shots follows.

Documentation

This is a tricky area and there is not a lot of documentation on the subject. This is one good overview note about personalization though the note does not have details on this topic: Note 743490.1Applications. There are discussions about similar topics on external forums like this one mentioned only as a reference. Note that links change and this was valid as of June 2010. Here is the link: technical/296-stored-procedure-form-personalization.

Example

Here is a simple example using a function in the database that queries values, then a personalization that sets the value queried from dual. In this example, the function is extremely simple but more complex logic can be used. Here isthe code entered for the personalization text entered as the value for the account. This example is defined in the miscellaneous transactions form (INVTTMTX.fmb) and passes the item number to the function:

=select JBP_TEST_f1(''||${item.MTL_TRX_LINE.ITEM.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 thatthe callout is made to replace the value of the item before passing the 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.

Here is the example routine used - this just does a simple select from dual but other advanced logic could be used:

create or replace function JBP_TEST_f1 (p_value in varchar2 default 'none') return varchar2 asl_return_variable varchar2(1000) := 'No Value';beginselect 'x' into l_return_variable from dual;return(p_value||'+'||l_return_variable);end;/

Setup Steps

Video - Viewlet recording of personalization (05:57)

1. In SQL, create the function:

create or replace function JBP_TEST_f1 (p_value in varchar2 default 'none') return varchar2 asl_return_variable varchar2(1000) := 'No Value';beginselect 'x' into l_return_variable from dual;return(p_value||'+'||l_return_variable);end;/

* Create the function and ensure it is valid. Here is an example SQL for checking for invalids:

select object_name, object_type, owner, statusfrom dba_objectswhere status = 'INVALID'order by object_name

2. Open the form that you want to personalize, then choose Help > Diagnostics > Custom Code > Personalize. In this case, the miscellaneous transactions form is opened.

Rate this document

Page 2: Support.oracle.com CSP Main Article Cmd=Show&Type=NOT&Doctype=HOWTO&Id=1130255.1

3. Enter the main information about when this personalization will be active.

4. Enter the action information detailing what the personalization will do.

=select JBP_TEST_f1(''||${item.MTL_TRX_LINE.ITEM.value}||'') from dual

Page 3: Support.oracle.com CSP Main Article Cmd=Show&Type=NOT&Doctype=HOWTO&Id=1130255.1

5. Save the changes and test the personalization.

6. In this case, the item number is passed from the screen to the database function. The function returns the same value plus a value retrieved from the database. The value is then replaced for the Account field on the screen.

References

NOTE:460363.1 - How To Change Default Behavior Of Serial Entry Form To "Individual" from "Range" using Personalization FeatureNOTE:743490.1 - Customization in Oracle Applications

Related

Products

Oracle E-Business Suite > Logistics > Logistics > Oracle Inventory Management

Keywords

PERSONALIZE; PERSONALIZATION; CUSTOM CODE; FORM PERSONALIZATION; INVENTORY MANAGEMENT; MISCELLANEOUS TRANSACTION; STORED PROCEDURES

Back to top

Copyright (c) 2007, 2010, Oracle. All rights reserved. Legal Notices and Terms of Use | Privacy Statement