Error with "Add new Row" button in Master detail VO

Hi,
Am having a header VO , Forecast HeaderVO and a child VO
ForecastLineVO, now forecastHeaderVO has two bind condition attached to it,and when we run header Vo line VO will automatically execute as they are linked by a view link.My child Vo is attached to a advance table, which has a ADD Another Row button,Now when i press the button for the case where no header is is there it shows me a error"Failed to find or invalidate owning entity".
Below am giving the coding what i have written in the AM to handle the Add New Row button,
public void createForecastTarget(String month, String year,String fortnight,String forecastmonth,String forecastyear)
ForecastLineVOImpl vo1=getForecastLineVO();
ForecastHeaderVOImpl vo=getForecastHeaderVO();
System.out.println("Start");
vo.setWhereClauseParam(0,month);
vo.setWhereClauseParam(1,year);
//vo.setWhereClauseParam(2,fortnight);
vo.setWhereClauseParam(2,forecastmonth);
vo.setWhereClauseParam(3,forecastyear);
vo.executeQuery();
if (!(vo1.isExecuted()))
throw new OAException("ASF", // Message product short name
"MIS_SEARCH_PENDING");
// We need to do this on a VO that has not been queried before we insert
// our first row. We don't want to do it for subsequent inserts.
System.out.println(vo.getFetchedRowCount());
if (vo.getFetchedRowCount() == 0)
// vo.setMaxFetchSize(0);
int rownum = vo.getFetchedRowCount() ;
OARow row = (OARow)vo.createRow();
int rownum1 = vo1.getFetchedRowCount() ;
System.out.println("In between");
OADBTransaction transaction = getOADBTransaction() ;
Number forecastid = transaction.getSequenceValue("MIS_FORECAST_HEADER_S");
Number forecastlineid = transaction.getSequenceValue("MIS_FORECAST_LINE_S");
System.out.println(forecastid+" "+forecastlineid);
row.setAttribute("ForecastId",forecastid);
row.setAttribute("DataEntryMonth",month);
row.setAttribute("DataEntryYear",year);
row.setAttribute("DataEntryFortnight",fortnight);
row.setAttribute("ForecastMonth",forecastmonth);
row.setAttribute("ForecastYear",forecastyear);
vo.insertRowAtRangeIndex(rownum,row);
vo.clearCache();
transaction.commit();
// Required per OA Framework Model Coding Standard M69
row.setNewRowState(row.STATUS_INITIALIZED);
OARow row1 = (OARow)vo1.createRow();
row1.setAttribute("ForecastId",forecastid);
row1.setAttribute("ForecastLineId",forecastlineid);
System.out.println("forecast id"+forecastid);
vo1.insertRowAtRangeIndex(rownum1,row1);
// Required per OA Framework Model Coding Standard M69
row1.setNewRowState(row1.STATUS_INITIALIZED);
else
int rownum2 = vo1.getFetchedRowCount() ;
System.out.println(rownum2);//+vo1.getCurrentRow().getAttribute(1))
System.out.println(vo.first().getAttribute("ForecastId"));
OARow row2 = (OARow)vo1.createRow();
row2.setAttribute("ForecastId",vo.first().getAttribute("ForecastId"));
OADBTransaction transaction = getOADBTransaction() ;
Number forecastlineid1 = transaction.getSequenceValue("MIS_FORECAST_LINE_S");
row2.setAttribute("ForecastLineId",forecastlineid1);
// row2.setAttribute("DeleteAttr", "N");
vo1.insertRowAtRangeIndex(rownum2,row2);
// Required per OA Framework Model Coding Standard M69
row2.setNewRowState(row2.STATUS_INITIALIZED);
System.out.println("forecast line id"+forecastlineid1);
Now while debugging i found out that am getting the error in the if block
in the code
OARow row1 = (OARow)vo1.createRow();

Hi,
Summit ,again am getting the error and i think am getting it in the line when am trying to create one for line VO
as OARow row1=(OARow)vo1.createRow();
Below am giving the stack trace
Exception Details.
oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1142)
     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1294)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2396)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
     at OA.jspService(OA.jsp:40)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
     at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
     at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
     at mis.oracle.apps.asf.dcp.frcst.webui.ForecastDealerCO.processFormRequest(ForecastDealerCO.java:158)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
     at OA.jspService(OA.jsp:40)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
     at java.lang.Thread.run(Thread.java:534)
oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
     at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
     at mis.oracle.apps.asf.dcp.frcst.webui.ForecastDealerCO.processFormRequest(ForecastDealerCO.java:158)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
     at OA.jspService(OA.jsp:40)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
     at java.lang.Thread.run(Thread.java:534)
Please help.

Similar Messages

  • Issue with ADD NEW ROW button

    Hi,
    When I click 'ADD NEW ROW ' button, an empty row is getting created as the last but one column.
    I want the new row should be add at last. (as the last row). The code I am using :
    Row row = vo.createRow();
    vo.last();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Can anybody please tell me how to get it.
    Thanks,
    Swaroop

    Hi Shiv,
    I just added a 'Add New Row' submit nutton.
    In Controller I added the following code:
    if (pageContext.getParameter("Addrow") != null)
    am.invokeMethod("createrow",null);
    In AM code I've written:
    public void createrow()
    OAViewObject vo = (OAViewObject)getEntityshift2VO1();
    Row row = vo.createRow();
    vo.insertRow(row);
    vo.last();
    row.setNewRowState(Row.STATUS_INITIALIZED);
    --Swaroop                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Row Level PPR in Advanced Table with Add More Rows Button

    <br>
    I have programmatically fired PPR event on MessageChoice. But it is in Advanced Table with
    Add More Rows Button. When the value is changed in MessageChoice I Show/Hide Custom LOV
    through SPEL like this ${oa.BioEmployeePVO.EmpManagerRender} .
    But it is <b>hiding the all the ROWS</b> not just the row where the value has been changed.
    I even tried with this code and get NULL for rowReference.
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    In Processrequest()
    String pageName = pageContext.getRootRegionCode();
         Hashtable params = new Hashtable (1);
         params.put ("param1", pageName);
         Hashtable paramsWithBinds = new Hashtable(1);
        paramsWithBinds.put ("param2",new OADataBoundValueFireActionURL (mcb, "{$AttendeeType}"));
        mcb.setFireActionForSubmit ("empPositionChange", params, paramsWithBinds,false, false);
    In ProcessFormRequest() {
    if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))   
          String rowReference = pageContext.getParameter("param2");
        //    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
         Serializable[] parameters = { rowReference };
          am.invokeMethod("handlePositionChangeEvent", parameters);
    <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    HI Kumar,
    Answer to your last post is "yes".
    Now to your doubt regarding the code:
    Hi Anna
    I am trying to understand your code.
    FireAction firePartialAction = new FirePartialAction("fireHideEvent"+(i/noOfTlaColSpan));
    HideImgBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
    1. What is this i/noOfTlaColSpan ?
    :)Forget abt this in your case it should be the event name which u r firing and capturing the it in the PFR.
    Like FireAction firePartialAction = new FirePartialAction("YOurEventName");
    and in PFR u can capture tht as:
    if("YOurEventName".equals(pageContext.getParameter(EVENT_PARAM)))
    //your logic to invoke AM method
    2. I believe this HideImgBean would be MessageChoice for me?
    :)Yep ur right
    3. This brcdOhInventoryViewUpdateVOImpl would be the Custom PVO(Extending Seeded Base VO)
    I create by adding the transient attributes?
    :)Yep ur right
    4. I cannot understand this code. Could you explain.
    :)Please look at my comments in some of the lines .I have explained wht i am doing
    if(updateIter==null)
    updateIter[0]= invViewVO.createRowSetIterator("updateIter");//This initViewVo should be ur custom VO object
    if(cnt>0)
    updateIter[0].setRangeStart(0);
    updateIter[0].setRangeSize(cnt);
    for(int i=0;i<cnt;i++)
    row = (brcdOhInventoryViewUpdateVORowImpl)updateIter[0].getRowAtRangeIndex(i);
    String selectFlag=(String)row.invokeMethod("getPartNumber");//This getPartNuber should be replaced by the Prim Key inoke methd of ur VO
    if(RowID.equals(selectFlag))
    //This is my logic to set the transient attributes based on the msgChoiceBean value ..u have to pass the value when u invoke this method
    if(reserveMethod.equals("BINARY"))
    System.out.println("In Binary");
    Boolean bVal= new Boolean("false");
    Serializable sr[]={bVal};
    Class []methodParamTypes = { bVal.getClass() };
    row.invokeMethod("setshowreservetxt",sr,methodParamTypes);
    Boolean bVal1= new Boolean("true");
    System.out.println("bVal1"+bVal1);
    Serializable sr1[]={bVal1};
    Class []methodParamTypes1 = { bVal1.getClass() };
    row.invokeMethod("setShowreservemsgchoice",sr1,methodParamTypes1);
    break;
    In my AM I am doing this. Am i doing right?:)Yep u r right
    BioPrescribersPVO is the custom VO(extending seeded base VO).
    public void handlePositionChangeEvent(String param)
    OAViewObject vo = (OAViewObject)findViewObject("BioPrescribersPVO");
    OARow row = (OARow)findRowByRef(rowReference);
    if (row != null)
    String position = (String)row.getAttribute("AttendeeType");
    if (("PRESCRIBER".equals(position)) )
    // BioEmpManagerRender is the transient attribute in BioPrescribersPVO.
    row.setAttribute("BioEmpManagerRender", Boolean.TRUE);
    row.setAttribute("BioPresManagerRender", Boolean.FALSE);
    else
    row.setAttribute("BioEmpManagerRender", Boolean.FALSE);
    row.setAttribute("BioPresManagerRender", Boolean.TRUE);
    } // end handlePositionChangeEvent()
    // Initializing the custom VO
    /*No need to initialize the VO because this is not a PVO(Propeties View object)
    U r just using the existing VO and tht vo shloud have a primary key.Tht way u can match the rowref u r getting with the actual row from the View object*/
    public void init()
    OAViewObject appPropsVO = (OAViewObject)getBioPrescribersPVO();
    if (appPropsVO != null)
    if (appPropsVO.getFetchedRowCount() == 0)
    appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery();
    appPropsVO.insertRow(appPropsVO.createRow());
    OARow row = (OARow)appPropsVO.first();
    row.setAttribute("RowKey", new Number(1));
    handlePositionChangeEvent("");
    } // end init()
    Thanks
    Anna

  • Create a new row in a table without using add new row button

    I want to add a new row to the table without using the add new row button of the table. I'm not able to display default row in the table. Though if click on apply the record appears after saving in the database. Any thoughts how to implement this functionality.

    Here is what you have to do.
    1) You have to handle this in processRequest()
    2) In the AM code , u need to check if there is already a row exisit or vo is blank
    if (vo.getFetchedRowCount() == 0)
    // first time
    vo.setMaxFetchSize(0); // THIS IS REQUIRED.
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    else
    //If already rows are there then you suppose to insert in the end
    // i assume you would have execute your vo
    YourVORowImpl row= (YourVORowImpl)vo.getRowAtRangeIndex(0);
    vo2.insertRowAtRangeIndex();
    It should work.

  • Weird Problem with Add Row Button in Master Detail Page

    I have a page that was created with a Master Detail Wizard. When I click the Add Row button on our Production Environment, the row counter increments BUT no blank row shows on the screen.
    In our Development Environment, when I click the Add Row button, a blank row appears as expected. Thinking there was some problem with the production app, I exported the Dev version and imported into Production. Still no blank row.
    Thinking perhaps it had something to do with the data, I copied our production application data back into the development application tables. Still, the development app creates the blank row where the production version does not.
    I even used the same browser window for both environments and still get the same results. This was working fine in production then just stopped one day.
    The only clue I have is that the Add Row WILL work if the Master Record has no details or less than a page worth. It seems to happen when the detail records are more than one page worth. Also, when I click the Add Row button, it goes to the last page of the list (say three pages of 10, 10, 6) but no blank row shows up. Again, works fine in the development environment no matter how many pages.
    Any ideas or suggestions why this is happening? Could there be some environment setting that is causing this to happen?

    I have a page that was created with a Master Detail Wizard. When I click the Add Row button on our Production Environment, the row counter increments BUT no blank row shows on the screen.
    In our Development Environment, when I click the Add Row button, a blank row appears as expected. Thinking there was some problem with the production app, I exported the Dev version and imported into Production. Still no blank row.
    Thinking perhaps it had something to do with the data, I copied our production application data back into the development application tables. Still, the development app creates the blank row where the production version does not.
    I even used the same browser window for both environments and still get the same results. This was working fine in production then just stopped one day.
    The only clue I have is that the Add Row WILL work if the Master Record has no details or less than a page worth. It seems to happen when the detail records are more than one page worth. Also, when I click the Add Row button, it goes to the last page of the list (say three pages of 10, 10, 6) but no blank row shows up. Again, works fine in the development environment no matter how many pages.
    Any ideas or suggestions why this is happening? Could there be some environment setting that is causing this to happen?

  • Add multiple rows with add a row button

    Not sure of how to add this to my script, but my dilemma is I would like to add the row above in addition to the current row.
    Right now the script in the "add row" button is:
    Table1._Week.addInstance(0);
    the row above is Table1._Above
    How do I go about adding the row above to the script?
    Thanks

    You can access the instance manager of any Row from anywhere in the form..
    So you can write script by being in the Week Row to add a new row for Above row.
    In your click event you can write like this..
    Table1._Above.addInstance(0);
    Thanks
    Srini

  • Creating a new row in a master detail VO relation and its consequences.

    Hi,
    I'm currently facing a lot of problems which make me doubt if my perception about the whole ADF entity-view object mechanism is right.
    I have a page which displays data from a master detail VO relation (master offer - detail officeinfo). I also have a small dialog LOV window which makes it possible for me to select an office to match up with the current offer... Both the office LOV and the officeInfo detail use the same Office entity object.
    This worked perfectly fine until I wanted to add create NEW offers. I created my own insert method which basically performs a createRow on the master VO and inserts the newly created row in this VO. On a sidenote, I also fill out some default data read from a property file, which is why I decided to implement my own insert method in the first place.
    Initially, the problem was that the inputText fields of the detail VO (OfficeInfo) were not displayed at all. I imagined that I also had to perform the create and insert methods on the detail VO and indeed, from that point on all inputText fields were displayed and my page was ready for input.
    Yet today, I notice that in my Office LOV which is based on the same entity as the one my detail OfficeInfo VO uses, this newly created row is ALSO visible. To me this is quite unwanted and surprising behavior. I did not expect the row already to be visible in the LOV, since basically it's just an empty row ready for input...
    Am I perceiving things wrong? Or anyone has a nice solution to fix this?
    Thanks,
    Douglas

    Hi Douglas,
    It is happening because you have created an updateable office LOV which is based on same entity object used to save your newly created records.
    Use readonly LOV based on plsql query in your page and you can keep rest of the thing as it is.
    I think it will solve your problem.
    Cheers,
    Suyog

  • Add new row Button

    Can an option be added to duplicate a selected row?

    I second the request. That's one option that is missing in several tools I've worked with in the past like Toad, SQL Navigator and dbSaint. Oracle Forms had this feature and even now when I want to set up data for some applications, I have to go in and create an Oracle Form manually to get this functionality . It would be really useful to have this inside the tool.
    Thanks
    Al

  • Advance table Add another row button error  ---Error: Cannot Display Page

    hi, i m new to OAF.
    I m trying to add new row programatically to my advanced table, but getting the error
    Error: Cannot Display Page
    You cannot complete this task because one of the following events caused a loss of page data:
    Your login session has expired.
    A system failure has occurred.
    My page has two EOs with two differnt tables Table A(Accident details) and Table B(Victim Details).Table A is Parent of Table B.No relation is defined in my page for these two tables so far.Foreign key is not defined.
    On my page I have various field for entering data for Table A and its saving data properly
    For table B i have taken the Advanced table.When i click on Add row button of table i m getting the said error.
    My CO
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
        OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
         System.out.println("processFormRequest ");
         if(pageContext.getParameter("Save")!=null)
            am.invokeMethod("apply",null);
            System.out.println("Save ");
      if  ("addRows".equals(pageContext.getParameter("event")) && "AdvTblRN".equals(pageContext.getParameter("source")) )
      System.out.println("The source is :"+pageContext.getParameter("source"));
      String p_header_id = (String)pageContext.getTransactionValue("p_tx_header_id");
      Serializable[] param = {p_header_id};
      am.invokeMethod("createRow", param);
       am.invokeMethod("apply",null);
       System.out.println("Add Row ");
      pageContext.forwardImmediatelyToCurrentPage(null,false,"N");;
    And AM
    public void createRow( String p_header_id)
    Row prow;
    VictimDtlVOImpl pvo= getVictimDtlVO1();
    pvo.setMaxFetchSize(0);
    prow=pvo.createRow();
    pvo.insertRow(prow);
    prow.setNewRowState(Row.STATUS_INITIALIZED);
       OAViewObject vo1 = (OAViewObject)getVictimDtlVO1();
    OADBTransaction transaction1 = getOADBTransaction(); 
      System.out.println("---- "+transaction1.getSequenceValue("XXMIS_SAFETY_VICTIM_DTL_SEQ"));
      Row row1 = vo1.createRow();
       vo1.insertRow(row1);
      row1.setAttribute("VictimId",transaction1.getSequenceValue("XXMIS_SAFETY_VICTIM_DTL_SEQ")); 
      row1.setNewRowState(Row.STATUS_INITIALIZED);
    public void apply()
    try {
      getOADBTransaction().commit();
    System.out.println("Commit ");
    plz help .......
      catch (Exception e)
       e.printStackTrace();

    Hi Vaishali,
    Use below code for add line in Nested Table.
    if(pageContext.getParameter("addRows") != null){
            OAAdvancedTableBean sectionsTable = (OAAdvancedTableBean)webBean.findChildRecursive("AdvTblRN");
            OAInnerDataObjectEnumerator sectionsEnum = new OAInnerDataObjectEnumerator(pageContext, sectionsTable);
            while(sectionsEnum.hasMoreElements()){
                RowSet sectionsRowSet = (RowSet) sectionsEnum.nextElement();
                for(int i = 0; i < 1; i++){
                    OARow newRow = (OARow) sectionsRowSet.createRow();
                    sectionsRowSet.insertRowAtRangeIndex(sectionsRowSet.getRowCount(), newRow);
    Thanks,
    Dilip

  • How to add new rows in Advanced Table along with attribute value?

    Hi,
    I have one advanced table that contain one messageChoice and messageTextInput field.
    I want to add new rows in advanced table. I can able to add rows using the AddMoreRows button in the footer of the advanced table,
    but I want to add attribute value(contactId) each time when new row created.
    contactId I am getting from pageContext.getParameter("contactId")
    How to achive this? Please suggest.
    Thanks & Regards,
    Sunita

    Hi,
    There are two ways to do it.
    1. Use create method of entity object, create method fires whenever you creates new row.
    2. Handle the event raised by addanotherrow button and write logic there to initialize contactid as you are getting contactid from pageContext so I will suggest you to use this method.
    if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))
    && ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
    //write your logic here to default the contact id
    Hope this will help.
    Regards,
    Reetesh Sharma

  • Add new bank account in master data client with idoc DEBMAS.

    Hi friends,
    I have an issue.
    I am trying to add new bank account in master data client with idoc DEBMAS.
    But when I submit, then just overwrite the bank data but not add.
    I try playing with MSGFN code with value '009' or '004' but nothing done.
    Someone has met this issue ?
    Thanks for your answers.

    Thanks,
    But what do you mean ? where can I find this path , in img ?
    Fields->Set Qualified Update ->Append Option
    I think we have to use another idoc :
    BUPA_C_BANKDETAIL_ADD01 SAP BP,  BAPI: Add Bank Details
    I'll try...

  • How to add new row in KL02 trx - Activity type control data

    Hi guys.
    I am not a FI-CO consultant, but I want to add a row since KL02 transaction within a cost center, with a new fiscal year. When you access KL02 (change activity type), you set the activity type, then press Master Data and the basic screen appears. If you press the Display planning control button, you will see the "Display Activity Type Control Data" List. I wanna add a row for a specific cost center here, because the cost center I refer has not 2011 as fiscal year. I tried to use, since basic screen of KL02, use the Change planning control button, but when I set my cost center and 2011 as fiscal year, the Save button is inactive. Furthermore, I tried to press the Period screen and a message appeared "No data has been entered yet". So I dont know how to add one row for a cost center in the Planning control (Activity type control data) list of the KL02 transaction, specifically for an activity type. Do you know? Thanks in advance

    Hi,
    The list of cost centers in which the activity type is planned is given in KL02 under planning data.  In order to add a new cost center to this, you need to enter the activity type in transaction KP26 for a particular year. 
    Goto transaction KP26
    Give version - 0
    from period 1 to 12
    year - 2011
    cost center - mention the cost center
    Activity type - mention activity type
    goto overview screen F5 and add the plan price for the activity in the cost center.  This step will automatically add new row in the activity type control data.
    Hope this helps.
    Thanks,
    Ram

  • Best method to add new rows

    Hi,
    I am new to apex and would like your suggestions as to the best method to add new row to a table. I do not want to use the wizard because there are many tables in the db. From reviewing this forum, the suggested method is to create the report with a form, the user clicks the 'create' button and it opens up to a new form for data entry. There is a 'submit' button to commit the changes to the table. When/How do I create the PK? Is it at the page render when the new form is opened or in page process when all the fields are committed? I tried to add the 'insert into table..' in the page render to create the new PK but I received oracle error. Am I missing a step? Thanks very much.
    Judy

    Good Morning,
    I have a second question to ask about Inserting rows..I was successful with the sql statement in adding a row to the parent table. Now I need to insert a row in the related child table. There are approx 5 child tables where I need to be able to add rows.
    My questions as to the proper sequence to do this:
    1. do I execute the Insert for the parent table first?
    2. then have the user click the button to add info for the child table and then click another button that does the insert into the child table? At this point, is this where I reference the parent table(fac_seq.currval)?
    INSERT INTO CONTACT(cnt_pk, fullname, street1, city, state, zip, phone, title)
    VALUES (CNT_SEQ.nextval,FAC_SEQ.currval,
    NVL(:P36_FULLNAME, 'No Data'),
    NVL(:P36_STREET1,'No Data'),
    NVL(:P36_CITY, 'No Data'),
    NVL(:P36_STATE,'CA'),
    NVL(:P36_ZIP,'00000'),
    NVL(:P36_PHONE,'555-1212'),
    NVL(:P36_TITLE,'No Data'));
    3. is it proper procedure to have separate insert statements or is it better to have 2 insert statements?
    INSERT INTO FACILITY(fac_pk, fac_type, fac_name, street1, city, state, zip, state_or_tribe, tribe_yn)
    VALUES (FAC_SEQ.nextval,
    NVL(:P211_FAC_TYPE, 'N'),
    NVL(:P211_FAC_NAME,'No Data'),
    NVL(:P211_STREET1,'No Data'),
    NVL(:P211_CITY, 'No Data'),
    NVL(:P211_STATE,'CA'),
    NVL(:P211_ZIP,'00000'),
    NVL(:P211_STATE_OR_TRIBE,'CA'),
    NVL(:P211_TRIBE_YN,'N'));
    INSERT INTO WELL(wel_pk, fac_fk, cnt_fk, geo_fk, well_state_uk, name,site, high_priority_yn,aqui_exempt_yn, well_in_swa)
    VALUES (WEL_SEQ.nextval, FAC_SEQ.currval, CNT_SEQ.currval, GEO_SEQ.currval,
    NVL(:P47_WELL_STATE_UK, '09DI'),
    NVL(:P47_NAME, 'No Data'),
    NVL(:P47_SITE,'No Data'),
    NVL(:P47_HIGH_PRIORITY_YN, 'N'),
    NVL(:P47_AQUI_EXEMPT_YN, 'N'),
    NVL(:P47_WELL_IN_SWA,'U'));
    **I am confused as to how to approach the process of adding rows to a child table. Please clarify for me or direct me to a link that has detailed documentation.
    Many thanks,
    Judy

  • Add new row to a table bound to ArrayList in backing bean

    Hi,
    I have a Arralist<CustomObject> in the backing bean.
    I want to create a table with Add/Delete new row buttons which will add/delete objects from the ArrayList.
    I am using Jdev 11g and I am not using ADF BC.
    Please give me some heads up or links.
    Thanks

    Then that's your problem, change the class to something like:
    public class TableHandlerConsumer
        private static final String LIST_PAGE_FLOW_ATTR = "consumers:" + TableHandlerConsumer.class.getName();
        public TableHandlerConsumer()
            Collection data = new ArrayList<Consumer>();
            buildModel(data);
            tableModel = new SortableModel(data);
            Map<String, Object> pageFlowScope = RequestContext.getCurrentInstance().getPageFlowScope();
            pageFlowScope.put(LIST_PAGE_FLOW_ATTR, tableModel);
        private void buildModel(Collection data)
            baris.add(new Consumer("", "", "", "", ""));
            baris.add(new Consumer("", "", "", "", ""));
            baris.add(new Consumer("", "", "", "", ""));
        public void addRow()
            Consumer consumer = new Consumer();
            ((Collection)tableModel.getWrappedData()).add(Consumer);
        public SortableModel getTableModel()
            Map<String, Object> pageFlowScope = RequestContext.getCurrentInstance().getPageFlowScope();
            return (SortableModel)pageFlowScope.get(LIST_PAGE_FLOW_ATTR);
    }Note that if you're using 10g then change Requestcontext to AdfFacesContext and getPageFlowScope to getProcessScope
    Regards,
    ~ Simon

  • Editable ALV (CL_GUI_ALV_GRID) Pasting add new rows

    Hi all,
    I have a problem with OO ALV.
    I'm using class CL_GUI_ALV_GRID as I need to have a couple of editable columns.
    Let's say that we have columns Material and Quantity. And Quantity is editable.
    Toolbar buttons for adding new rows, paste, copy, are all disabled.
    Suppose I have 2 rows in the ALV.
    If I copy to clipboard from, for example, Excel, more than 2 rows, and paste them in Quantity column of the ALV, the result is that new rows are inserted till all the information in the clipboard is pasted. The new rows have all blank values except for the column I'm pasting.
    I do not want this rows inserted. I supposed that this wounldn't happened, as there are no buttons for inserting rows.
    Anybody knows how to change this behaviour?
    Thanks a lot.
    Alejandro Galliano.

    Hi Alejandro,
      You can implement your own functionality to create new row.You can add your own button in ALV   for New row creation. In another simple way is you place the button in the screen which display the ALV and implement the logic in PAI of the screen.
    the logic is simple add new row in the internal table which you are using to display ALV and refresh the ALV.Then your new row will appear in the Grid.
    Regards,
    Mike

Maybe you are looking for