Need help: error creating record

Hi refugees,

Gud morning...

I get this error during the creation of the new record twice (for the first record, it works fine...)

As master details page, I am Manager differently which... first of all I save the details of masters and while saving the level of detail, I will assingn the id of the header to the attribute display... when I create the first new record and save it works fine... but when I try to create a record more it shows error... This is the code... AMImpl

It is showing the error in the createRecord() method only... it runs until the row.setNewRowState (Row.STATUS_INITIALIZED) after that only it is throwing error (assigning values for the attributes of display...) But for the first record it works fine...

Please... give your valuable suggestions...

' Public Sub createRecord (pageContext OAPageContext, OAWebBean webBean)

{

saveMasterDtls (pageContext, webBean);

String vunitid = pageContext.getParameter ("ctrlUnitId");

String vapproval_id = pageContext.getParameter ("ctrlApprovalId");

OAViewObject vo = getcapexApprovalHierarchyVO1();

Try

{

String ctrl_headerId = null;

Conn connection = (Connection) pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

String query = "select header_id OF XXNH_CAPEX_APPROVALS where unit_id =: 1 and APPROVAL_id =: 2;

PreparedStatement stmt = conn.prepareStatement (query);

stmt = conn.prepareStatement (query);

stmt.setString(1,vunitid);

stmt.setString(2,vapproval_id);

ResultSet rs = stmt.executeQuery ();

RS = stmt.executeQuery ();

While (RS. Next())

{

ctrl_headerId = rs.getString (1);

System.out.println ("id of the header in all new record:" + ctrl_headerId);

}

If (! vo.isPreparedForExecution ())

{

searchRecords (pageContext, webBean);

}

Line line (Row) = vo.createRow ();

vo.insertRow (row);

row.setNewRowState (Row.STATUS_INITIALIZED);

System.out.println ("before assigning values id...");

vo.getCurrentRow () .setAttribute ("HeaderId", ctrl_headerId);

vo.getCurrentRow () .setAttribute ("UserUnitId", vunitid);

}

catch (System.Exception e)

{

throw new OAException ("error creating record:" + OAException.ERROR, e);

}

}

=======================

' Public Sub saveMasterDtls (pageContext OAPageContext, OAWebBean webBean)

{

/ * checking already Masters details existed or not for unity & approval * /.

System.out.println ("master dtls start");

String v_unitid = pageContext.getParameter ("ctrlUnitId");

String v_unitName = pageContext.getParameter ("ctrlUnitName");

String v_approval_name = pageContext.getParameter ("ctrlApprovalName");

String v_approval_id = pageContext.getParameter ("ctrlApprovalId");

OAApplicationModule am = pageContext.getApplicationModule (webBean);

int cnt = 0;

Try

{

Connection pconn = (Connection) pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

String pquery = "select count (*) FROM XXNH_CAPEX_APPROVALS where unit_id =: 1 and APPROVAL_id =: 2;

PreparedStatement stmt = pconn.prepareStatement (pquery);

stmt.setString(1,v_unitid);

stmt.setString(2,v_approval_id);

ResultSet rs = stmt.executeQuery ();

While (RS. Next())

{

CNT = rs.getInt (1);

}

System.out.println ("count is:" + cnt);

If (cnt == 0)

{

System.out.println ("If condition start");

Tran OADBTransaction = getOADBTransaction();

Number v_header_id;

v_header_id = am.getSequenceValue ("XXNH_CAPEX_APPROVAL_SEQ");

capexApprovalVOImpl vo = getcapexApprovalVO1();

If (!) VO.isPreparedForExecution ())

{

vo.executeQuery ();

}

Line = vo.createRow ();

row.setNewRowState (rank. STATUS_INITIALIZED);

row.setAttribute ("UnitId", v_unitid);

row.setAttribute ("UnitName", v_unitName);

row.setAttribute ("ApprovalName", v_approval_name);

row.setAttribute ("ApprovalId", v_approval_id);

row.setAttribute ("HeaderId", v_header_id);

vo.insertRow (row);

getTransaction () .commit ();

System.out.println ("unless condition end");

}

on the other

{

capexApprovalVOImpl vo = getcapexApprovalVO1();

vo.executeEmptyRowSet ();

}

}

catch (System.Exception e)

{

throw new OAException ("error in recording: master Dtls prepare Stmt query:" + OAException.ERROR, e);

}

}

============================================

' Public Sub searchRecords (pageContext OAPageContext, OAWebBean webBean)

{

String v_unitid = pageContext.getParameter ("ctrlUnitId");

String v_approval_id = pageContext.getParameter ("ctrlApprovalId");

OAViewObject vo = getcapexApprovalHierarchyVO1();

vo.setMaxFetchSize(-1);

vo.setWhereClause (null);

vo.setWhereClauseParams (null);

int v_header_id = 0;

Try

{

Connection pconn = (Connection) pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

String query = "select header_id from xxnh_capex_approvals, including 1 = 1 and = unit_id: 1 and APPROVAL_ID =: 2;

PreparedStatement stmt = pconn.prepareStatement (query);

stmt.setString(1,v_unitid);

stmt.setString(2,v_approval_id);

ResultSet rs = stmt.executeQuery ();

While (RS. Next())

{

v_header_id = rs.getInt (1);

vo.setWhereClause ("HEADER_ID =" + v_header_id);

}

vo.executeQuery ();

}

catch (System.Exception e)

{

throw new OAException ("error in query records...") Prepare the query Stmt: "+ OAException.ERROR, e);

}

}

============================================================

Best regards and thanks,

Jaya...

Jaya,

could you please check if the Id of the header is marked as primary key in database level or the level of the view object.

Concerning

GYAN

Tags: Oracle Applications

Similar Questions

  • I need help to create actions.

    I need help to create actions.

    Hi andrewr,.

    Here are the tutorials that you can use to create actions:

    Record steps in Photoshop | Adobe Photoshop CC tutorials

    Create actions in Adobe Photoshop

    Kind regards

    Claes

  • Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column determines if the entry price column is subtracted from the price of output column or output subtracted

    Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column; Determines if the entry price column is subtracted from the price of output column (buy) or subtracted from (Sell) entry exit. Thank you for your help

    Hi B',.

    Buying and selling in column B

    Price of entry in column c.

    Exit in column D price

    Formula (and outcome) in column E

    If the column will B always contained 'Buy' or 'Sell', it works. It is default to a calculation of 'sell' if sale or has been specified.

    E2: = IF (B = "Buy", D - C, C - D)

    If you want to delay the calculation until the amounts entered in C and D, use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, C - D) ")

    If you want to delay the calculation until all three ducks are on a line (B contains buy or sell, C and D contain both data), use this version:

    E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, IF(B="Sell",C-D,) "" ")))

    Third version used in this table.

    Kind regards

    Barry

  • Hello all, I need help with creating a dynamic region in jdeveloper 11.1.2.3 version

    . Hello everyone, I need help with creating a dynamic region in jdeveloper 11.1.2.3 version

    What JDK you are using?

    You are probably using an old version of the JDK, that class while compiled under JDK 1.7.0

    http://java67.blogspot.com/2012/10/how-to-fix-javalangunsupportedclassversionerror-major-minor-version-49-50-51.html

    For example, work with the correct version, and it will be fine...

  • Please help: error creating files the digital certificate is not valid

    Hello, I have a problem to publish .air for Flash Professional CS5.5 desktop. When I create the certificate (.p12) file, and then click Publish but apparently alert dialog box is "error creating files the digital certificate is not valid. Your certificate has expired the Mar Mar 12 15:34:32 ICT 1963 "How could I do to solve this case and export the only desktop .air file?

    Double post, responded to Please help: error creating files the digital certificate is not valid.

    Locking thread.

  • Need help to create a workspace to keep my guides and leaders to a predefined dimension.

    Need help to create a workspace to keep my guides and leaders to a predefined dimension?

    Might be interesting to set up an action to do this.

    The next time that you create your folder of the workspace, an action, then you have this will define and at a click of a button you will have the same workspace each time.

  • Need help to create a count up animation

    Hello. I'm new (ish) FlashCS6 and need help to create a timing of the animation. I'm fine with a general flash animation, but have never really used action script, are not my hand holding a little. any help would be great.

    Basically, I have 12 scenes someone is going through their daily lives by buying items and at the end of each scene I have a small graph of cash that opens - I need then of numbers to animate quickly count for example, from £ 0 to £369 for a few seconds.

    Thanks in advance

    Chris

    The toFixed() method should do what you need.  By my previous code example...

    cashGraphic.cashDisplay.text = ' £' + cashValue.toFixed (2);

    The toFixed method returns a string value, so you don't have to cast one in coding as I showed earlier.

  • I need help on creating reports on the intranet.

    I need help on creating reports on the intranet.
    My level: Beginner cf.
    Y at - it a book for report design? And structures for reports?
    ------------------------------------------------requirements
    my form needs one

    · Date of the box you want. (from and to).
    · Option button to choose the csv and html
    · Run and throw out the results in a tabular format. (grids, cell)


    How many cfm pages do need me for this? E.g. display, action.
    What called what?
    What else do I need?

    I suggest that you put your project on hold for a little everything and get and read the chapters appropriate Web Application Construction Kit of Ben Forta. You can learn more about it here - http://www.forta.com/books/0321223675/. Once you have the concepts down, you will have a much more concentrated idea on what to do.

  • Need help to create a new Xbox account

    I deleted my Xbox Live account, a long time ago and I want to create a new. My old Xbox Live account is associated to my the Microsoft Account. But when I want to create an Xbox Live account, it says I have one using my that already have Microsoft Account. I'm sure I deleted my Xbox Live account and when I go on my Xbox Live account in the Internet, it says this, "Uh oh... that shouldn't happen." It seems that you have found a bug in the system. Please try again later. "I need help, I really want to create a new Xbox Live account using my course Microsoft Account. Thank you.

    Hello

    Your Question is beyond the scope of this community.

    I suggest that repost you in the correct forum.

    'Home'

    http://forums.Xbox.com/

    "Xbox forums.

    http://forums.Xbox.com/xbox_forums/general_discussion/f/3817.aspx

    "Xbox Forums directory.

    http://www.Xbox.com/en-us/forums

    See you soon.

  • Need help to create a pdf file

    I need help creating a PDF with me for free!

    Thanks everyone, I solved the problem.

  • Need help to create a scrollbar in HTML table

    Hello dreamweavers!

    I need help here please...

    I need to create a table with three columns... or a webpage... that has the ability to scroll when things are added.


    This is a music site and page Web will be a list - a database of all sorts - of each title artist and album. If there are say, 200 titles in the catalog, then I need to list them all on one page and in 3 columns towards the bottom of the page. What I did using a table in HTML in Dreamweaver. The problem is each title on the table is static and when adding in a new title in the catalog, ALL securities will have to be moved manually. So, I need to create a table where when I add another title (they will be alphabetical) say to am' for example, then all of the other titles will be automatically moves along a (somewhat as in a Word document by adding a new line). Everything else is automatically shifted. I don't know if this is still possible in Dreamweaver?

    I hope that I have explained this correctly. It's quite a strange problem, and as such, I have been unable to find anything on this forum or google search.
    If anyone can help that would be most excellent! I'd be happy.

    Questions - if you need further information please ask

    I use Dreamweaver CS5.5 Version 11.5 Build 5315

    I have a Macbook Pro with Snow Leopard if that's at all relevant.

    My site is on Wordpress with the theme, Suffusion. I can link to it, if someone needs.

    Here is a picture of the table, as I did, to give an idea what it looks like:

    columns.jpg

    Thank you!

    P.I.G > /.

    big dreamers never sleep

    Mylenium was right. You must use a database for this server-side.

    Maintenance of static tables with this amount of data is going to be a logistical nightmare - not even worth considering.   Get an indexing plugin for WordPress.

    Nancy O.

  • Need help to create a custom connector

    I need help on developing custom Homegrown application connector and the version I use is OIM9.0.3
    First of all, what are the steps we need care while developing a custom connector.
    I can't able to find the process in google to develop the custom connector.
    If you have all data related to the development of the connector custom, please share to me...

    What are the thing we need to take care while developing the connector.
    I spoke in the version OIM9.1 there is a possibility to develop the custom connector using the Genric technology, we can create the custom connector using the IOM GTC 9.1 feature

    early response will be appreciated

    I think the approach to take here will depend to a large extent what are the characteristics of the request of the House. Where it stores its user and the right information? It exposes an API or perhaps the database tables that you can use for commissioning?

    In general, you need to create the following in IOM:

    (1) a Type of COMPUTER resource
    (2) a COMPUTER resource
    (3) a resource object
    (4) a form of customized process
    (5) a procurement process
    (6) task of process adapters (allows to really reach out to the target application and perform commissioning activities)

    Please come back with more information on what you are trying to integrate with and I can give you hope that some other points.

    Rob

  • BlackBerry Smartphones need help on my record of e-mail on my curve 8520

    Need help

    How to use the same folder email on my blackberry?

    When I change my mobile network and register again my bb email and Setup again with my old email, my bb will make a new folder to store my email.

    How can I change my setting of bb always using my old e-mail folder?

    Thank you

    Yep, moble different suppliers, different accounts BIS BlackBerry Internet Service.

    I don't understand the problem. Look at your main message folder. Press the Menu key > settings for the Inbox, can you choose here what email accounts go to the main folder of Messages?

  • Need help to create dynamic VO

    Hi experts,
    Need code to create dynamic VO

    --
    MD

    Hi MD,.
    use following code

    String sql1 = "SELECT col1, col2, col3 from table1 where ';"
    SQL1 = sql1 + "col1 =: 1";
    ViewObject vo = am.findViewObject (">");
    If (vo is nothing)
    VO = am.createViewObjectFromQueryStmt (">", sql1 ' ");
    vo.setWhereClauseParams (null);
    vo.setWhereClauseParam (0, >);
    vo.executeQuery ();

    --
    Thank you
    Shrikant

  • I need help to create an e-newsletter

    I learned, I can create an e-newsletter with graphics and a header using Adobe Dreamweaver, but I have no idea where to start. It will be impossible for a person with few computer skills (someone like me)?

    I use Dreamweaver CS4.

    Thanks for any help.

    [Thread moved to general Discussion Dreamweaver forum]

    Do you mean by "a few computer skills" you have no knowledge of web design, then you will not be able to create a newsletter with Dreamweaver. Dreamweaver is a professional tool for web site designers or other people at least the basics of html and css.

    If you have some basics of html and css, or are willing to learn (there are plenty of tutorials online), you can use DW to help you create the room of email marketing. Here are some links that will give you some information about creating email marketing documents:

    SitePoint has some good information on their website:

    http://www.SitePoint.com/article/code-HTML-email-newsletters/

    http://www.SitePoint.com/article/designers-guide-HTML-email/

    http://www.SitePoint.com/article/principles-beautiful-HTML-email/

    Chimp Mail is also another site with some great help, including html email templates free and a free guide in pdf:

    Design beautiful Emails

    Html email resources

Maybe you are looking for