Sunday, September 13, 2009

Open Workflow status monitor diagram page in OAF

Create a VO for the query which is given below through this you can get the current diagram url,

select WF_MONITOR.GetDiagramURL(WF_CORE.Translate('WF_WEB_AGENT'),NtfEO.MESSAGE_TYPE,NtfEO.ITEM_KEY,'NO') monitor_url from
(SELECT ITEM_KEY,MESSAGE_TYPE FROM WF_NOTIFICATIONS WHERE NOTIFICATION_ID = :1) NtfEO

First find the button component of your page.
call VO with the input parameters which will return the diagram url.
Put that url into the java script function.

Through the java script you can open a new popup window which will display the status monitor diagram

OASubmitButtonBean reAssignBea1n = (OASubmitButtonBean) paramOAWebBean.findChildRecursive("WfMonDiagramCtrl");

Serializable[] parameters1 = { NotificationId };
Serializable aa1 = am.invokeMethod("getMonitorURL", parameters1);
if (aa1 != null && !aa1.toString().equals(""))
{
String url = "window.open('" + aa1.toString() + "')";
paramOAPageContext.putJavaScriptFunction("LaunchMonitor", url);
}

Determine the transaction state that is, whether changes have been made to view objects or not

Use the following methods:

ApplicationModule.getTransaction().isDirty() - This method tells you whether the transaction contains any changes in the view objects. This works for transactions made by entity object-based view objects only.

OAViewObject.isDirty() - This method tells you whether a particular view object contains changes or not. This works for both entity object-based view objects and view objects based on OAPlsqlViewObjectImpl. For view objects based on OAPlsqlViewObjectImpl, you can also use OAPlsqlViewObjectImpl.getState() method

Always call remove() after done using a dynamic view object

Always call VO.remove() after you are done using a dynamic view object:

ViewObject voobject = null;
try
{
voobject = mTransaction.createViewObjectFromQueryStmt("sql statement");
boolean exists = ( voobject.first() != null);
}
finally
{
voobject.remove();
}
Make sure to surround your VO.remove(); with finally.
If you don't, a java runtime exception could fire before you even get to your VO.remove().

Create a run time VO in OA framework

To create a run time VO you have to follow these steps which are given below:

OAApplicationModule am = pageContext.getApplicationModule(webBean);

OADBTransaction oadbtransaction = am.getOADBTransaction();
String validateStr1 = "select column_name from table_name where column_name = :1";

ViewObject validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 == null)
validateViewObject1 = (ViewObject)am.createViewObjectFromQueryStmt("ValidateCodeVO1", validateStr1);

validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 != null)
{
validateViewObject1.setWhereClause(null);
validateViewObject1.setWhereClauseParam(0, pageContext.getParameter("NtfId"));
validateViewObject1.executeQuery();
validateViewObject1.reset();

oracle.jbo.Row validaterow = validateViewObject1.first();

if (validaterow != null)
message_type = validaterow.getAttribute(0).toString();
}

Monday, September 7, 2009

Moving setup from one instance to another in oracle R12

The Generic Loader (FNDLOAD) is a concurrent program that can transfer Oracle Application entity data between database and text file. The loader reads a configuration file to determine which entity to access. In simple words FNDLOAD is used to transfer entity data from one instance/database to other. for example if you want to move a concurrent program/menu/valuesets developed in DEVELOPMENT instance to PRODUCTION instance you can direct use this command.

Steps to Move a Personalization from one instance(Database) to other

Define your Personalization and save it in first instance
Connect to your UNIX box on first instance and run the following command to download the .ldt file

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME

Move the downloaded .ldf file to new instance(Use FTP)
Connect to your UNIX box on second instance and run the following command to upload the .ldt file

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt

Note: Make sure you are giving proper .lct file in the commands and don’t confuse with .lct and .ldt files
These following are the other entity data types that we can move with FNDLOAD

1 - Printer Styles
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcppstl.lct file_name.ldt STYLE PRINTER_STYLE_NAME="printer style name"

2 - Lookups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct file_name.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="FND"
LOOKUP_TYPE="lookup name"

3 - Descriptive Flexfield with all of specific Contexts
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt DESC_FLEX P_LEVEL=’COL_ALL:REF_ALL:CTX_ONE:SEG_ALL’ APPLICATION_SHORT_NAME="FND" DESCRIPTIVE_FLEXFIELD_NAME="desc flex name" P_CONTEXT_CODE="context name"

4 - Key Flexfield Structures
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt KEY_FLEX P_LEVEL=’COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:SHA_ALL:CVR_ALL:SEG_ALL’ APPLICATION_SHORT_NAME="FND" ID_FLEX_CODE="key flex code" P_STRUCTURE_CODE="structure name"

5 - Concurrent Programs
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME="FND" CONCURRENT_PROGRAM_NAME="concurrent name"

6 - Value Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET_VALUE FLEX_VALUE_SET_NAME="value set name"

7 - Value Sets with values
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET FLEX_VALUE_SET_NAME="value set name"

8 - Profile Options
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct file_name.ldt PROFILE PROFILE_NAME="profile option" APPLICATION_SHORT_NAME="FND"

9 - Request Groups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct file_name.ldt REQUEST_GROUP REQUEST_GROUP_NAME="request group" APPLICATION_SHORT_NAME="FND"

10 - Request Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct file_name.ldt REQ_SET
APPLICATION_SHORT_NAME="FND" REQUEST_SET_NAME="request set"

11 - Responsibilities
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct file_name.ldt FND_RESPONSIBILITY RESP_KEY="responsibility"

12 - Menus
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct file_name.ldt MENU MENU_NAME="menu_name"

13 - Forms Personalization
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME

Move Folder from one instance to another instance in oracle apps

Move Folder from one instance to another instance in oracle apps:

You can find the respected lct file under following path /u00000/oracle/developement/apps/apps_st/appl/fnd/12.0.0/patch/115/import, which are required to move anything from one instance to another instance in oracle apps.

To move folder three tables are mainly effected which are
FND_FOLDERS
FND_DEFAULT_FOLDERS
FND_FOLDER_COLUMNS

Download ldt file : FNDLOAD APPS/APPS 0 Y DOWNLOAD $FND_TOP/patch/115/import/fndfold.lct NEW_FOLDER.ldt FND_FOLDERS NAME=NEW

Upload ldt file : FNDLOAD APPS/APPS 0 Y UPLOAD $FND_TOP/patch/115/import/fndfold.lct NEW_FOLDER.ldt

Friday, September 4, 2009

Table Registration API

You register your custom application tables using a PL/SQL procedure in the AD_DD package.

Therefore you only need to register those tables (and all of their columns) that will be used with flexfields or Oracle Alert.

You can also use the AD_DD API to delete the registrations of tables and columns from Oracle Application Object Library tables should you later modify your tables. If you alter the table later, then you may need to include revised or new calls to the table registration routines. To alter a registration you should first delete the registration, and then re-register the table or column. Remember, you should delete the column registration first, then the table registration. You should include calls to the table registration routines in a PL/SQL script. Though you create your tables in your own application schema, you should run the AD_DD procedures against the APPS schema. You must commit your changes for them to take effect.

The AD_DD API does not check for the existence of the registered table or column in the database schema, but only updates the required AOL tables. You must ensure that the tables and columns registered actually exist and have the same format as that defined using the AD_DD API. You need not register views.
Procedures in the AD_DD Package

1. Procedure REGISTER_TABLE

procedure register_table ( p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_tab_type in varchar2,
p_next_extent in number default 512,
p_pct_free in number default 10,
p_pct_used in number default 70);

2. Procedure REGISTER_COLUMN

procedure register_column (p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_col_name in varchar2,
p_col_seq in number,
p_col_type in varchar2,
p_col_width in number,
p_nullable in varchar2,
p_translate in varchar2,
p_precision in number default null,
p_scale in number default null);

3. Procedure DELETE_TABLE

procedure delete_table (p_appl_short_name in varchar2,
p_tab_name in varchar2);

4. Procedure DELETE_COLUMN

procedure delete_column (p_appl_short_name in varchar2,
p_tab_name in varchar2,
p_col_name in varchar2);

To find out the table associated with which application, You can use these queries

select * from fnd_tables where table_name = 'CS_INCIDENTS_ALL_B'
select * from fnd_application where application_id = 170