The requested page contains stale data Error

Hi All,
I have two table in the back end. VikCountry(country_code PK,country_name).
VikCities(country_code FK,city_name).I have created two EO's and TWo VO's for them and the AssociationObject.
In the UI ,I have two messageTextInput fields, one for the country code and one for the country name,And a Advance table having a "Add Another Row" button at footer level.In UI i want to enter the data i.e Country Code,Name and Cities for that country(Master Detail Relation ship)
Following is the code that i have written in the CO file:-
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
RnDAMImpl AM = (RnDAMImpl)pageContext.getApplicationModule(webBean);
if(!AM.getVikCountryVO1().isPreparedForExecution())
AM.getVikCountryVO1().executeQuery();
Row row1 = AM.getVikCountryVO1().createRow();
AM.getVikCountryVO1().insertRow(row1);
row1.setNewRowState(Row.STATUS_INITIALIZED);
if(!AM.getVikCitiesVO1().isPreparedForExecution())
AM.getVikCitiesVO1().executeQuery();
Row row2 = AM.getVikCitiesVO1().createRow();
AM.getVikCitiesVO1().insertRow(row2);
row2.setNewRowState(Row.STATUS_INITIALIZED);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
RnDAMImpl AM = (RnDAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("Submit")!=null)
AM.getOADBTransaction().commit();
else if(pageContext.getParameter("Cancle")!=null)
if(AM.getTransaction().isDirty())
AM.getOADBTransaction().rollback();
else if(pageContext.getParameter(EVENT_PARAM).equals("addRows"))
System.out.println("inside the addrows");
Row row2 = AM.getVikCitiesVO1().createRow();
AM.getVikCitiesVO1().insertRow(row2);
row2.setNewRowState(Row.STATUS_INITIALIZED);
Now when i am entering the data in the UI and press submit button,then It is giving me an error:-
The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
Cause:
The number of displayed records, 1, exceeds the actual number of records, 0, in view object RnDAM.VikCitiesVO1. Some of the displayed records may have been deleted..
I am unable to solve this Problem.Please Help.
Thanks,
Vikram

Q:Why are you creating new Rows for Country and City VO in processRequest ?
A:Bcoz to insert the empty rows in the VO cache.
Q:And then again in processFormRequest you are creating another row for the Cities VO.
A:As i set the Insert Row Automatically property to false, when user select the "Add Another Row" button in UI, i am inserting an empty row in the VO cache.
If there is anything wrong plz let me know.
Q:When does error happen when you try to add another row or when you try to commit the transaction ?
A:When i am commiting and if i fill the data in the textboxes and table, and press Add Another Row Button in table.

Similar Messages

  • Several Issue: Stale Data Error with 2 pages opened at same time

    Hello Gurus,
    I developed an OAF page to create and also update records. My page, depending from the operation, can show the data on fields, for update, or blank, on case to create records. This page contains one LOV field, input fields and textarea field to get the data.
    When i try record or update using one page per time, the LOV field works fine and records are uptodated with success.
    But if i use 2 pages or more in these situations:
    - one page is opened in update operation;
    - another page to create a new record.
    Issue: When i click to change the LOV field value on create page, or update page, the Lov pop-up is opened with success, but when i click in another value, i get this error below. Any action also can cause this error, like click on Back Button (with name 'Voltar', created by me). Please see the error below:
    Error: Stale Data*
    The requested page contains stale data.*
    This error could have been caused through the use of the browser's navigation*
    buttons (the browser Back button, for example).*
    Cause:*
    The view object XXXAM.XXXVO1 contained no record.*
    The displayed records may have been deleted, or the current record for the view*
    object may not have been properly initialized.*
    This error hapens when i open 2 pages on update operation mode also.
    This error dont hapens only when i open 2 pages on create operation mode.
    Ps:
    Note: I have an ApplicationModule (AM) for LOV and another AM for this page, but i used this other AM to another page too and VOs. Have any problem on this???
    To help to understand, i printed my page, u can see the screenshots on links below:
    http://imageshack.us/a/img850/9186/printforum1.png
    http://imageshack.us/a/img197/2185/printforum2.png
    I´ll print some code blocks and if u need know more code blocks, please tell me:
    My PageCO Controller, at processFormRequest, code to define update or create Operation:
    +if (row.getNewRowState() == Row.STATUS_NEW) {+
    operationType = createOperation;
    +} else {+
    operationType = updateOperation;
    +}+
    My Controller, at processRequest, update or create operation:
    +if (!pageContext.isFormSubmission()) {+
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String reqHeaderId =
    pageContext.getParameter("requisitionHeaderId");
    +Serializable[] params = {reqHeaderId};+
    IcxReceivingAlreadyExistsVOImpl receivingExistsVO = (IcxReceivingAlreadyExistsVOImpl)am.findViewObject("IcxReceivingAlreadyExistsVO1");
    receivingExistsVO.initQuery(reqHeaderId);
    +if (receivingExistsVO.hasNext()) {+
    TransactionUnitHelper.startTransactionUnit(pageContext, UPDATE_RECEIVER_TRX);
    am.invokeMethod("initPersonQuery", params);
    +} else {+
    TransactionUnitHelper.startTransactionUnit(pageContext, CREATE_RECEIVER_TRX);
    am.invokeMethod("createReceivingPerson", params);
    +}+
    +}+
    My AMImpl.java :
    +public void createReceivingPerson(String reqHeaderId) {+
    OAViewObject vo = getIcxReceivingPersonVO1();
    +if (!vo.isPreparedForExecution()) {+
    vo.executeQuery();
    +}+
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    row.setAttribute("RequisitionHeaderId", reqHeaderId);
    +}+
    +public void initPersonQuery(String reqHeaderId) {+
    IcxReceivingPersonVOImpl vo = getIcxReceivingPersonVO1();
    +if (vo == null) {+
    +MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "IcxReceivingPersonVO1")};+
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    +}+
    vo.initQuery(reqHeaderId);
    +}+
    +public void apply() {+
    getTransaction().commit();
    +}+
    +public void rollback(){+
    Transaction txn = getTransaction();
    +if (txn.isDirty()) {+
    txn.rollback();
    +}+
    +}+
    In the hope of a solution, waiting for ur precious help, Gurus
    My true thanks since now,
    Best Regards,
    Alberto Bogéa

    Hi,
    Can you please tell, if you are using the same EO/VO combination for both the operation - Insert and Update on both screens.
    Quite possible, that when you open two screen in say Update Mode and you open the two List Of Values, then as soon as you have selected the value in one of the LOV, the Other LOV will throw you stale data as the same VO/EO is being used.
    Try using two different EOs/VOs combination and see if that helps.
    Regards,
    Saurabh Agrawal

  • Stale data error for a new page (based on an existing native sshr page)

    Without going into too much detail on why I'm doing this, I copied an existing oracle native page, renamed it, and loaded it into the MDS.
    I navigate to the page by creating an extension on a controller to take me to there on a button click. Also on this page, the native page that I copied is also accessible. There is a similar button click to take you to the native page.
    I had a business requirement to create records for the current year (the native page), and records for next year. Using a dff to differentiate between the two types of records was not an option.
    The copied page is used to simply create records. I extended the native controller to default a value behind the scenes (This is how I differentiaing between the current/next year records). The super.ProcessForm/superProcessFormRequest are there as well in this controller. From there, the page is using the same code as the native page that I copied.
    When I click the "Save As Draft", "Apply", "Cancel" buttons, it works fine.
    However, when I click on the "Apply Add Another" button, I'm getting the following error:
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The record with primary key values {13002} could not be found in view object
    AppraisalsAM.ObjectiveEditAM.ObjectivesVO.
    To proceed, please select the Home link at the top of the application page to return to the main menu.
    Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    I've researched this error all day today on prior postings/threads, and I haven't found a posting that is similar to the one that I outlined.
    I wouldn't think I would have to do anything programming wise since this is all native code, and the native page works fine. I'm guessing somewhere the native page is getting reference that is causing this error....
    Any help would be appreciated.
    Thanks

    You could use HIDE/UNHIDE funtionality for page 2
    1) create page 2 with all values ...
    2) on page 1 - add jJavascript to show or hide Page 2 dependin on value
    if (fieldvalue eq "condition") them
    Page2.presence = "visible"
    else
    Page2.presence = "hidden"
    endif

  • Stale Data Error in seeded OAF page

    Hi All,
    In my custom oaf page I used master-detail between two tables using PPR (with single selection radio button in master table). From time to time I get "Error: Stale Data ..."
    Absolutely the same error I was able to reproduce in seeded oaf page (R12.1.2):
    1. open OA Framework ToolBox Tutorial -> Sample Browser -> Partial Page Rendering (PPR)
    2. expand Coordinate Master Detail Tables
    3. select first record (Supplier Number 1) and wait when the page will be fully refreshed
    4. VERY FAST select second and immediately third record.
    After that I get:
    Error: Stale Data
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The number of displayed records, 3, exceeds the actual number of records, 1, in view object SampleBrowserAM.SupplierSitesVO1. Some of the displayed records may have been deleted
    Additional conditions:
    1. Your connection to server should be "a little slowly" (in my case it's VPN). If apps server is in your local network you can get response very fast and will not get error. In this case repate 1-4 several times.
    2. Browser - IE7 or IE8. In FireFox 3.6 works fine.
    Thanks in advance.
    Regards,
    Sergey

    Hi
    Are you using
    if (!vo.isPreparedForExecution()) if (! vo.isPreparedForExecution ())
    vo.executeQuery(); vo.executeQuery ();
    for VOs in process request of base page!For detailed explanation on this look at this thread: for VOs in process request of base page.
    Please refer this thread may be it help you out..
    Re: Page Refresh and Page Date Rollback
    Ajay

  • Stale Data error when invoking seeded OAF from a custom OAF page

    Hi All,
    We have a requirement in OAF where we have to open a Seeded OAF Page (Install Base) from our Custom Page. We are using the javascript function “openWindow()” to open the page in a new window. When we close the seeded page by clicking seeded page window using the Window-close button and then perform any event on the custom page, we get the Stale Data error as given below.
    Error: Stale Data
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The number of displayed records, 2, exceeds the actual number of records, 1, in view object OwqAM.IKNCICOWQDetailVO1. Some of the displayed records may have been deleted.
    Here is the part of code we have tried.
    String destination = "/OA_HTML/RF.jsp?function_id="+Func_Id+"&"+"resp_id="+Resp_id+"&"+"resp_appl_id="+Application_id+"&security_group_id=0&lang_code=US";
    String testDest = "javascript:openWindow(top,'"+destination+"',null,{width:750, height:550},false,'document',null);void(0);";
    OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();
    bodyBean.setOnLoad(testDest);
    Also this issue is encountered only when we open an OAF page in a new window. We also have a functionality where a JSP page is opened on similar lines, but above said navigations do not result in the same error.
    If anyone has come across such a issue and have a resolution, please let me know. Any pointers would be of great help.
    Thanks,
    Mrugesh

    Hi,
    We had tried passing RetainAM = Y and then bouncing apache. Still we were getting the same error.
    We are not facing the STALE DATA issue when we invoke JSP page and oracle forms. It is only when we launch a seeded OAF page from our custom OAF page that we are getting this error.
    Regards,
    Mrugesh

  • Stale Data Error - iProcurement Receiving Page

    Hi,
    I created a button on the Standard iProc Receving Page result table region. When user hit on button it popup window using javascript:window.open(<Page info & Properties>). I am using popwindow to capture some details, and saving into database. But when i am closing and coming back to my main page(Recieiving Page) and navigating to next page it is giving me the Stale Data Error.
    Interstingly this error does not come when the search is done using reqeustor or if i dont click on button for popup window. All other cases gives me this error. One info about this page is the VO which is showing in error should not execute all the time. There are lot of VO's which execute based on search fields entered. The VO belowi s one of them when reqeustor info is given in search fields.
    Error: Stale Data
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The number of displayed records, 25, exceeds the actual number of records, 0, in view object ReceiveItemsAM.ReceiveMyItemsVO. Some of the displayed records may have been deleted.
    Any pointers will be appreciated.
    Thanks & Regards,
    Venkata.

    Hi
    Generally Oracle provide a global variable hr_general.g_data_migrator_mode and passing this as 'Y' should update who columns and object version number. But I am not sure it is available for vacancy APIs or not. I remember a similar kind of bug logged long time back.
    Regards
    Gaurav

  • Hoe to resolve stale data error?

    Hi All,
    we are creating a simple UI page using OAF.
    Our UI contains a Textinput box and a Go button.
    For any value entered in the text box and Go button is clicked the corresponding value should be fetched from the database and displayed.
    For Example: If the emplyee number is entered and clicked Go, the employee name is fetched from a table in the database and get displayed.
    We are getting the stale error if we enter the employee number and Go is clicked.
    Developer Mode Error: Stale Data
    The requested page contains stale data
    Cause:
    The view object OAApplicationModule.OthrRN601_OthrRN_oracle_apps_ak_EmplyeesAM.CnEmployeesAllVO1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    Can anyone help us in resolving this error?
    Thanks in Advance.

    The required value should be fetched only after the Go button is pressed.
    So is it neccessary for the VO to get initialised before Go is clicked?
    Can you please explain how to resolve the error?
    I have given the code we are using...
    We are using the following code in controller file.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    int CompPlanId = Integer.parseInt(pageContext.getParameter("CPId"));
    String CName = "";
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    CName = am.invokeMethod("initCP(CompPlanId)").toString();
    *if(CName.equals("")){*
    throw new OAException("Comp Plan Not Found", OAException.INFORMATION);
    *else {*
    we are using the following code in our AMImpl.Java file.
    *initCP(int compPlanId) {*
    String CompName = "";
    CnCompPlansAllVOImpl vo =getCnCompPlansAllVO1();
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    *if(compPlanId != 0){*
    if(!vo.isPreparedForExecution())
    vo.initVo(compPlanId);
    CnCompPlansAllVORowImpl crow = (CnCompPlansAllVORowImpl)vo.first();
    if(crow == null)
    return(CompName);
    else
    CompName = crow.getName().toString();
    return(CompName);
    else
    *{ return(CompName);}*
    We are using the following code in VOImpl.Java file
    public void initVo(int compPlanId)
    *if(compPlanId != 0){*
    this.executeQuery(); }
    Edited by: user588642 on Sep 4, 2008 6:09 AM

  • Getting Stale Data error in show/hide of Advance table

    Hi,
    Am using hide/show in advance table.If open the hide/show in 1st row then it shows correct data ,if i click the next row's show hide then its shows the same result as ist row, and i try to use show/hide link more thann three times then it throws stale data error given below.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The record with primary key values {1400} could not be found in view object MisForecastHeadOfiiceAM.InnerTableVO_OuterInnerVL_InnerTableVO.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    This problem doen't exsist when i deplo it to the server.
    But recently i marked if open a show/hide link of a row and add then add another row to the table and save.Then the same problem reflects in the instance also.
    What may be the possible cause.
    Thanks

    if i click the next row's show hide then its shows the same result as ist row, and i try to use show/hide link more thann three times then it throws stale data error given below.
    >>> Seems like your VO linking is not proper. Does your VO have primary keys defined? Do you have any custom code on these VO?
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Getting Stale data error on Lov value selection.

    I am getting the following error on selecting value from the lov window, i am not executing Lov VO as such, can any one tell me the reason what is the cause.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object SubTabLayoutAM.FndUserLovVO1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.

    Hi,
    Use this code in process request of controller
    if(!am.getFndUserLovVO1().isPreparedForExecution())
    am.getFndUserLovVO1().executeQuery();
    Row row1 = am.getFndUserLovVO1().createRow();
    AM.getFndUserLovVO1().insertRow(row1);
    row1.setNewRowState(Row.STATUS_INITIALIZED);
    Thanks,
    Gaurav
    Edited by: Gauravv on Sep 4, 2009 6:11 AM

  • Stale data error:when clicked on lov

    Hi,
    In one particular form I'm having this issue. There are many lovs in this form. If I click on one lov and select a value, then immediately(before the value gets back to the text box of first lov) if I click on any other lov(I'm able to click on the second lov becuase this particular test enviroment is slow and while its processing the first lov, its allowing me to click on second lov. I'm not able to reproduce this in dev as the first lov value is returned immediately to the textbox ) I get this error message.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The record with primary key values {233} could not be found in view object AM.RequestHeaderVO1.
    I tried to reproduce the issue in another custom form in the same test environment but it works fine for this one.
    Can anyone please help
    Thanks
    Sunny

    Hi one more point, I'm using pageContext.isLovEvent() in PFR. Could this be causing my issue?

  • Stale Data Error in Last Page of the Table

    Hi,
    we are getting stale data error if we are performing any action in the Last Page of the Table.....
    It is working fine when we are performing an action on any other page... but when we are performing action on the Last Page of the Table we are encountering this Error
    Can someone please help me out of this Issue??
    Thanks,
    Sravanth

    if i click the next row's show hide then its shows the same result as ist row, and i try to use show/hide link more thann three times then it throws stale data error given below.
    >>> Seems like your VO linking is not proper. Does your VO have primary keys defined? Do you have any custom code on these VO?
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Stale data error while updating record on extending standard OAF pages

    We are on Oracle R12. I have a standard oracle shipped page to enter attributes of an inventory item. This page has an APPLY and CANCEL buttons to post the changes to DB. There is one attribute called FORMULA. To create a formula , I created a new custom page.
    I added a custom controller and AM to the standard page and added a new button, "Create Formula" . When the user clicks this button, he can navigate to the new custom page and create a formula. When the user clicks APPLY on this new page, I am navigating him back to the original page , looping through the Entity Object of that page and setting the formula attribute using method
    EO.SetATTRIBUTE.
    This works fine the first time. Then I click the apply button on the original page, the change is saved on teh DB. Now if I click the formula button again and try to modify the formula, on returning to the original page, the formula is updated but I also get the following error :
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    I tried getTransaction().setClearCacheOnCommit(true); after the setattribute but I still get this error . Not sure why this is happening, what I need to do.
    Please help . I did not modify any oracle shipped VOs or EOs.
    thanks
    Satya

    you can also release transaction by using
    pageContext.releaseRootApplicationModule();
    --Prasanna                                                                                                                                                                                                       

  • Unable to resolve stale data error in parent-child page structure.

    Hi Experts!
    I've got a master-detail page which consists of two VOs(EO based), Lets say
    1. MasterTableVO
    2. DetailTableVO
    This page contains two page buttons "Cancel" and "Apply" till here it works all fine & perfect[by that i mean creating, retrieving, querying etc etc.]
    But now i've created another page which is actually a child page of the above mentioned one.
    Here the user'll enter to view some default configured financial info or may also update the default settings manually.
    In this page, I've got only an advancedTable based on a VO(EO based), lets say
    3. PaymentsTableVO
    This page has only one page button "Ok" and which returns back to the parent page retaining the AM.
    All the three VOs are in the same AM. Functionally untill here also it looks fine, but when i finally apply the data it throws an error on getTransaction().commit();
    Error stack:
    OAF Error Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    Plz reply ASAP.
    Regards
    Ari

    Hi Sushant,
    Yepp !! I've done this in the AM. After invoking the method from the PGCO.
    Here's the code of the PGCO:
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package AmritTransportation.oracle.apps.po.Transportations.webui;
    import java.io.Serializable;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    * Controller for ...
    public class CostAllocationsPGCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isBackNavigationFired(false)) {
    TransactionUnitHelper.startTransactionUnit(pageContext,"CreateTxnCosts");
    if (!pageContext.isFormSubmission()) {
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAMessageTextInputBean Amount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Amount");
    String TransportationNum = (String)pageContext.getParameter("pTransportationNum")
    ,TransportationId = (String)pageContext.getParameter("pTransportationId")
    ,LockedFlag = (String)pageContext.getParameter("pLockedFlag")
    ,OrgId = (String)pageContext.getProfile("ORG_ID");
    Serializable[] param = {OrgId,TransportationId};
    if (LockedFlag.equals("N")) {
    am.invokeMethod("DefineDefaultCosts",param);
    else {
    am.invokeMethod("executeCosts",param);
    Amount.setReadOnly(true);
    else {
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"CreateTxnCosts",true)) {
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Ok") != null) {
    TransactionUnitHelper.endTransactionUnit(pageContext,"CreateTxnCosts");
    pageContext.forwardImmediately("OA.jsp?page=/AmritTransportation/oracle/apps/po/Transportations/webui/CreateTransportationPG&isChildPage=1"
    ,null
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,null
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    ===============================================================
    Here's the AM method DefineDefaultCosts:
    ===============================================================
    /**Custom public method to define default cost
    * allocation based on the pre-defined formula
    * for cost allocation keeping parity with the
    * corresponding delivery freight details
    public void DefineDefaultCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationCreateVO1()
    ,vo1 = (OAViewObject)getAmritTransportationPaymentsVO1()
    ,vo2 = (OAViewObject)getAmritTransportDeliveryLinesVO1();
    OADBTransaction txn = getOADBTransaction();
    ArrayList debugMessage = new ArrayList();
    HashMap PartySet = new HashMap();
    Boolean PartyEntryValid = null;
    String TransportationNum = (String)vo.getCurrentRow().getAttribute("TransportationNum")
    ,CurrencyCode = (String)vo.getCurrentRow().getAttribute("CurrencyCode")
    ,EventType = "TRNSP DELIVERED",PeriodName = null;
    Date AccountingDate = (Date)vo.getCurrentRow().getAttribute("DateDelivered");
    Number Amount = (Number)vo.getCurrentRow().getAttribute("Amount")
    ,Rate = (Number)vo.getCurrentRow().getAttribute("Rate")
    ,TripId = (Number)vo.getCurrentRow().getAttribute("TripId")
    ,OrgId = null,TransportationId = null,CodeCombinationId = new Number(576773);
    int DlvryRowCount = vo2.getRowCount(),CostDistRowCount = vo1.getRowCount();
    if (CostDistRowCount == 0) {
    try {
    OrgId = new Number(StrOrgId);
    TransportationId = new Number(StrTransportationId);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("Inherited Values: "+TransportationId+" "+TransportationNum+" "+CurrencyCode+" "+EventType+" "+AccountingDate+" "+Amount+" "+Rate+" "+OrgId));
    try {
    Connection Conn = txn.getJdbcConnection();
    String v$Script = "Select gp.period_name period\n" +
    "From gl_periods gp\n" +
    "Where upper(gp.period_set_name) = 'AMRIT_CALENDAR'\n" +
    "And gp.adjustment_period_flag = 'N'\n" +
    "And trunc(:1) between nvl(gp.start_date,trunc(sysdate))\n" +
    " and nvl(gp.end_date,trunc(sysdate))\n";
    PreparedStatement PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setDate(1,new java.sql.Date(AccountingDate.dateValue().getTime()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PeriodName = QryOutputRS.getString("period");
    v$Script = "Select attl.vendor_id vendorid\n" +
    " ,asp.vendor_name vendor \n" +
    "From apps.amrit_transport_trips att\n" +
    " ,apps.amrit_transport_trip_lines attl\n" +
    " ,ap.ap_suppliers asp\n" +
    "Where att.org_id = :1\n" +
    "And att.trip_id = :2\n" +
    "And att.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(att.start_date_active,trunc(sysdate))\n" +
    " and nvl(att.end_date_active,trunc(sysdate))\n" +
    "And attl.org_id = att.org_id\n" +
    "And attl.trip_id = att.trip_id\n" +
    "And attl.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(attl.start_date_active,trunc(sysdate))\n" +
    " and nvl(attl.end_date_active,trunc(sysdate))\n" +
    "And attl.location_type = 'HZ'\n" +
    "And asp.enabled_flag = 'Y'\n" +
    "And asp.vendor_id = attl.vendor_id\n" +
    "And trunc(sysdate) between nvl(asp.start_date_active,trunc(sysdate))\n" +
    " and nvl(asp.end_date_active,trunc(sysdate))\n";
    PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setInt(1,Integer.parseInt(OrgId.toString()));
    PreExecuteQuery.setInt(2,Integer.parseInt(TripId.toString()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PartySet.put(QryOutputRS.getString("vendorid"),QryOutputRS.getString("vendor"));
    }catch (Exception e) {}
    /* vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    PartyEntryValid = PartySet.add((Number)vo2.getCurrentRow().getAttribute("VendorId"));
    //debugMessage.add(new OAException("Set VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")));
    vo2.next();
    //debugMessage.add(new OAException("PartySet: "+PartySet.entrySet()));
    for (Iterator iter = PartySet.entrySet().iterator();iter.hasNext();) {
    Map.Entry entry = (Map.Entry)iter.next();
    String VendorName = (String)entry.getValue();
    Number Cost = null;
    int PartyId = Integer.parseInt(entry.getKey().toString());
    float Qty = 0;
    try {
    vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    //debugMessage.add(new OAException("VO VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")+" Cancelled: "+vo2.getCurrentRow().getAttribute("CancelFlag")));
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    int VendorId = Integer.parseInt(vo2.getCurrentRow().getAttribute("VendorId").toString());
    float Quantity = Integer.parseInt(vo2.getCurrentRow().getAttribute("Quantity").toString());
    if (PartyId == VendorId) {
    Qty+= Quantity;
    //debugMessage.add(new OAException("Quantities: "+Quantity+" "+Qty));
    vo2.next();
    Qty*= Float.parseFloat(Rate.toString());
    Float totalQty = new Float(Qty);
    Cost = new Number(totalQty);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("PartyId: "+PartyId+" VendorName: "+VendorName+" Cost: "+Cost+" EntryKey: "+entry.getKey()+" EntryValue: "+entry.getValue()));
    Row row = vo1.createRow();
    row.setAttribute("OrgId",OrgId);
    row.setAttribute("TransportationId",TransportationId);
    row.setAttribute("TransportationNum",TransportationNum);
    row.setAttribute("EventType",EventType);
    row.setAttribute("AccountingDate",AccountingDate);
    row.setAttribute("PeriodName",PeriodName);
    row.setAttribute("CodeCombinationId",CodeCombinationId);
    row.setAttribute("PartyId",PartyId);
    row.setAttribute("VendorName",VendorName);
    row.setAttribute("CurrencyCode",CurrencyCode);
    row.setAttribute("Amount",Cost);
    row.setAttribute("TransportationAmount",Amount);
    vo1.last();
    vo1.next();
    vo1.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    vo1.first();
    vo2.first();
    OAException.raiseBundledOAException(debugMessage);
    ===============================================================
    Here's the AM method executeCosts:
    ===============================================================
    /**Custom public method to execute the corresponding
    * transportation transactional cost allocations
    * and the distributive charges on the vendor accounts
    public void executeCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationPaymentsVO1();
    Number TransportationId = null;
    try { TransportationId = new Number(StrTransportationId); }catch (Exception e) {}
    if (!vo.isPreparedForExecution()) {
    if (TransportationId != null) {
    vo.setNamedWhereClauseParam("ReferredTransportationId",TransportationId);
    vo.executeQuery();
    ===============================================================
    Plz mention if something else is also required.
    Regards
    Ari :)

  • Stale data error while opening a multiple OAF page .

    Dear Friends ,
    I have a OAF page developed and deployed in server , its basically a search page , it also has several links to
    go to create page and update page . when the user opens the multiple page using different tabs in the browser
    like for example
    ex :
    from search page click on create page open it as new tab . if such multiple table are being opened
    and do some operation like search a record , it gives and error (stale data : Developer's mode exception ) .
    How to over come this exception , could you please share you ideas
    Thanks in Advance,
    Keerthi.k

    Hi friend ,
    In Search page i didn't do any update. and also search page is not a problem it's working fine. create page only the problem. In this page only throwing Stale data error exception.
    Please give me more suggestion.
    Thanks in advance,

  • Stale data error while submitting the form(before that opening the popup )

    I am using OAURL to open a pop-up in my oaf page
    passing my page to this class.And at the time of loading the base page
    the pop up window url is like this
    OA.jsp?page=/myfolder/webui/NumberColumnsPG&retainAM=Y&"+"fndOAJSPinEmbeddedMode=Y&addBreadCrumb=S&_ti=55514227&oapc=10
    now i click on the link to open the pop-up
    its opening the pop-up.
    Closing that pop-up.
    Saving the details entered in the base page.
    Now it is executing again from the processRequest() of base page
    now the URL like this...
    OA.jsp?page=/myfolder/webui/NumberColumnsPG&retainAM=Y&"+"fndOAJSPinEmbeddedMode=Y&addBreadCrumb=S&_ti=55514227&oapc=11
    Now i am getting stale data error
    The number of displayed records, 2, exceeds the actual number of records, 1, in view object SampleAM.SampleVO1. Some of the displayed records may have been deleted.
    Here i am observing that the parameter OAPC is different in these two URLs.
    can you please tell me how to come out of this error while i am submitting the base page.
    Thanks

    Hi Pratap,
    Thanks for your information.But there i didn't get any information related to my issue. can you please tell me a way to proceed further in order to solve this issue.
    Thanks
    Satya

Maybe you are looking for

  • Can I recover a previously saved version of a file?

    I'm working in CS3. I opened a file (saved as #3) and used it as a template for a new design, but before saving the new design with a new file name (that would be #4) I accidently hit the save shortcut. I do not have enough undos to go back to how #3

  • After upgrading to FF 19.0.2, google search keyboard shortcuts don't work

    I'm using www.google.com/ncr, and before the upgrade to FF 19.0.2, I could type in my search, press ENTER, then press TAB, and then select the page I want to view with the up and down arrows. This functionaltiy ceased to work :( It does still works o

  • Error -2146960888 when opening excel from labview using active x

    attempting to open an instance of excel from labview using active x, I even tried using the "open excel and make visible.vi" found on this site. I get errors every time, Inserting a break right after the property node, I found that it does open excel

  • ECC 5.0 and EP7.0 SP9 compatible

    Hi Experts, I am trying to implement ESS and MSS on ERP2004 and NW2004s SP09 (EP7.0) SP09. are the versions supported? where can i find the respective XSS component versions for EP7.0 SP9? to implement the BPs ESS 60.2, the online documentation says.

  • Where is my iMessage

    I have Mountain Lion and I can't find for the life of me iMessage on my MacBook Pro Retina. Is not on the dock, is not in the application folder and I can't find it through "Spotlight" Where is it or how do I get it?  Thanks in advance for your help.