Total Pageviews

Tuesday, June 14, 2011

Find a specific VO in AM.txt

            OAApplicationModule rootAM = pageContext.getRootApplicationModule();
           
            OAApplicationModule CompAM =
                 (OAApplicationModule)rootAM.findApplicationModule("BiddersListsAM");                                        

            OAViewObject BidVO =
                (OAViewObject)CompAM.findViewObject("BiddersListsVO");

            if (BidVO!= null) {
           
                Row BidRow = BidVO.getCurrentRow();
               
                   if (BidRow!=null) {
            
                   }
           
            }

Thursday, June 2, 2011

Show Error Message (using fnd messages)

This line requires you to create a custom message using Application Developer responsibility.
In this way your error message will be language specific.

throw new OAException("XXX", "XXX_READ_CUSTOM_MSG", null, OAException.ERROR, null);

Wednesday, June 1, 2011

Oracle Applications Framework Profiles

       Profile Name :Personalize Self-Service Defn
– Yes enables personalization link on all pages..This should be no in Production environment. For development team also it is better to set it yes at the user level
       Profile Name: FND: Personalization Region Link Enabled
– Yes displays all regional links
– Minimal displays key regional links
It is better to set the personalize link at the region level
       Profile Name :Disable Self-Service Personal
– Turn off all personalization
       Profile Name: FND: Personalization Document Root Path
– Used for importing/exporting personalization
       Profile Name: FND: Diagnostics
– Enables diagnostics on top right corner of the page

Populate Current Date and Time in OAF

OAApplicationModule am = pageContext.getApplicationModule(webBean);
SimpleDateFormat f = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String dateString = am.getOADBTransaction().getCurrentDBDate().toString();

java.sql.Date sqlDate= new Date(f.parse(dateString).getTime());

OAMessageDateFieldBean dateField =(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("currentDate");

dateField.setValue(pageContext,sqlDate);

How To Generate A SQL Trace In OAF


You can refer to Metalink note ID 357597.1
 
1. Set profile 'FND: Diagnostics' to Yes at user level.
2. Login to Personal Home Page as that user and select the 'Diagnostics' icon at the top of the page.
3. Select `Set Trace Level? and click Go
4. Select the desired trace level and click Save
5. Write down the trace id number(s).
6. Perform the activity that you want to trace
7. Return to the 'Diagnostics' page.
8. Select `Set Trace Level' and click Go
9. Select 'Disable Trace' and click Go.
10. Write down the trace id number(s) if different.
11. Go to user_dump_dest for your database and collect the raw trace file(s)
      suffixes by the trace id number(s) you have recorded.
12. Exit Applications.
Note: you can identify the user_dump_dest directory in your environment by running the following SQL:
SQL> select name, value from v$parameter where name like 'user%';

Find the correct version of JDeveloper

In order to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x,

you should refer to metalink note with ID 416708.1

For example, for Release 12.1 :

ATG Release 12.1 Version JDeveloper 10g Patch
12.1 (Controlled Release - only included for completeness) Patch 7315332 10G Jdev with OA Extension ARU for R12.1 (Controlled Release)
12.1.1 (rapidInstall or patch 7303030) Patch 8431482 10G Jdeveloper with OA Extension ARU for R12.1.1
12.1.2 (patch 7303033 or patch 7651091) Patch 9172975 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.2
12.1.3 (patch 9239090 or patch 8919491) Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.1 (patch 11894708) Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3

Hide a Button

OASubmitButtonBean saveT = (OASubmitButtonBean)webBean.findChildRecursive("Save1");
saveT.setRendered(true);

Disable a Button

OASubmitButtonBean saveT = (OASubmitButtonBean)webBean.findChildRecursive("Save1");
saveT.setDisabled(true);

Show Confirmation Message

OAException confirmMessage = new OAException("New Custom Message", OAException.CONFIRMATION);

pageContext.putDialogMessage(confirmMessage);

Launch a Workflow from OAF

public void launchWorkFlowFromOAF(OAPageContext pageContext)

{

String wfItemType = "XXSR";

String wfProcess = "SR_MAIN_PROCESS";

OADBTransaction transaction = getOADBTransaction();

String Sr_No ;

String wfItemKey = " ";

Sr_No = pageContext.getParameter("sr_no");

wfItemKey = Sr_No+ transaction.getSequenceValue("xxsr_key_s.NEXTVAL").toString();

OANavigation wfClass = new OANavigation();

// Create Workflow Process

wfClass.createProcess(pageContext, wfItemType, wfProcess, wfItemKey);

// Set Number Attribute: SR_NO

wfClass.setItemAttrNumber(pageContext,
                          wfItemType,
                          wfItemKey,
                          "SR_NO",
                          Sr_No);

// Start Workflow Process

wfClass.startProcess(pageContext, wfItemType, wfProcess, wfItemKey);

}

Loop Through Fetched Records in VO

This particular example was written for Oracle Sourcing.
It is very useful because you are able to get all records fetched from OAF, identify the ones you want
and do some work on them, by writing e.g. a pl/sql block.

       OAApplicationModule rootAM = pageContext.getRootApplicationModule();           
       OAViewObject ReqVO   =      (OAViewObject)rootAM.findViewObject("BidHeaderSectionsVO");
           
            if (null!=ReqVO) {
                Row ReqRow = ReqVO.first();           
                if (null != ReqRow) {
                           
                int idx = ReqVO.getRowCount();
   
                for (int xx = 0; xx < idx; xx++) {
                    if (null != ReqRow) {
                       // Do some work....
                       ReqRow = ReqVO.next();
                    }
                    else {}
                }
              }
            }

Forward to a New Page

This code requires you to setup a new function with name XXX_CUSTOM_PAGE, specify the complete path and assign this function to your responsibility.
 
String AuctionHeaderId = ReqRow.getAttribute("AuctionHeaderId").toString();
String BidNumber = ReqRow.getAttribute("BidNumber").toString();

HashMap hm = new HashMap(2);
hm.put("AuctionHeaderIdParam", AuctionHeaderId.toString());
hm.put("BidNumberParam", BidNumber.toString());

pageContext.setForwardURL("XXX_CUSTOM_PAGE", KEEP_MENU_CONTEXT, null,
  hm, false, ADD_BREAD_CRUMB_YES, IGNORE_MESSAGES);

Get the value of a check box field in a page

OAMessageCheckBoxBean InventoryCheckBoxBean = (OAMessageCheckBoxBean)webBean.findChildRecursive("InventoryCheckBox");

Object InventoryCheckBoxObj = InventoryCheckBoxBean.getValue(pageContext);
String InventoryCheckBoxValue = InventoryCheckBoxObj.toString();

Get Current Language

This code gets the system current language:

if (pageContext.getCurrentLanguage().equals("US"))
{
}

Create new button programatically

The following code requires you to setup a new custom message in Applications (Application Developer Responsibility) with name XXX_CUSTOM_MSG_BUTTON.


OASubmitButtonBean oasb =
    (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,
                                                                      "BUTTON_SUBMIT");
oasb.setID("xxCustomButton");
oasb.setUINodeName("xxCustomButton");
oasb.setEvent("xxCustomButton");

String printTextMsg = pageContext.getMessage("XXX","XXX_CUSTOM_MSG_BUTTON",null);
oasb.setText(printTextMsg);
oawebbean.addIndexedChild(oasb);

Compare Dates

The following code will help you compare 2 dates in OAF.You should write this in your extended controller:

                 Date out_date = null;

                 rootAM =  pageContext.getRootApplicationModule();
                
                 ReqHVO =  (OAViewObject)rootAM.findViewObject("AuctionHeadersAllVO");
                
                 ReqRow = ReqHVO.first();
                                                                            
                 out_date = (Date)ReqRow.getAttribute("CloseBiddingDate");
                
                 OAApplicationModule am = pageContext.getApplicationModule(webBean);
                 SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
                 Date current_date = am.getOADBTransaction().getCurrentDBDate();
               
                if (out_date.getValue().getTime() > current_date.getValue().getTime()) {
}