Duplicate a detail row to any position of a detail block

Hi,
The default performance of duplicate_record built-in is to copy the current detail row to the next created detail row.
I use this code to do this:
create_record;
duplicate_record;
How can i duplicate a row to any detail position of the detail block ?

As usual, you can accomplish this task in one or more ways.
Generally, I advise against using globals.
Basically, you need to store the content of a record temporarily into a dummy record or other type of collection based upon the current record structure.
The easiest, albeit the least reusable method, would be to create a dummy block with the same structure as the block containing the record you wish to duplicate.
Using buttons, pop-up menus, etc, copy the desired record from the source table to the dummy table and back. This target record need not be a new record depending upon your requirements. In any case, be aware of unique value and other constraints.
A more flexible solution would be to create a procedure, based upon a pl/sql table or other collection type that would duplicate the record structure on-the-fly. This could be included in a library and be usable by other forms.

Similar Messages

  • How to access detail-rows in master-detail form?

    I have a master-detail form(one to many relationship). The master and detail are in separate blocks. The detail rows are displayed in a tabular form.
    I need to access the detail-rows since the database writes for the detail rows will be managed by a procedure.
    I have been looking through the documentation and have been unable to find any syntax for iterating through the detail-rows.
    Any help is appreciated. Thanks.

    go_block(detail)
    first_record;
    in a loop while not last_record
    -- do your stuff
    next_record;
    end loop;

  • Master Detail Form - unable to add detail row

    Dear,
    I have a test application that runs for years on apex.oracle.com.
    Since 3rd of june 2010 I am unable to add rows on a detail form.
    Any ideas?
    Help is welcome!
    Kind regards
    Lorenz

    4.0 Conversion Issue
    Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
    I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
    My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
    Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
    Is this a reported 4.0 conversion issue?
    Jeff

  • How can i use row set iterator to create multiple dummy detail rows upfront

    Hello i am new to ADF and jdeveloper and have a Forms 9i/PLSQL background.
    I have a 1 to many master to detail view link and 2 vo's one for each of the master and detail table.
    I am trying unsuccsessfully to create 7 unique detail rows up front to populate at a later stage.
    I have created a master record with primary key being staff number and week ending date.
    i then use code below to try and create 7 detail records - P.S i have trimmed it to the first 2 for demonstration.
    I am using
    RowSetIterator rsi = this.mydetailVO.getRowSetIterator();
    Row newRow1=rsi.createRow();
    newRow1.setAttribute("Staff Num","123456A");
    newRow1.setAttribute("Week_Ending_Date", "2010-01-01");
    newRow1.setAttribute("Claim_Date", "2010-01-01");
    newRow1.setAttribute("Day", "Sun");
    rsi.insertRow(newRow1);
    Row newRow2=rsi.createRow();
    newRow2.setAttribute("Staff Num","123456A");
    newRow2.setAttribute("Week_Ending_Date", "2010-01-01");
    newRow2.setAttribute("Claim_Date", "2010-01-02");
    newRow2.setAttribute("Day", "Sat");
    rsi.insertRow(newRow2);
    However it does create two rows but it always writes over the first row with the details of the second row so they are not unique.
    How can i get a new unique row inserted with different details to the firat and how then do i access it uniquely.
    Thanks

    John thanks for reply.
    I have tried the following and still i get 2 rows created but the first one gets overwritten with the last one. I'm confused as to why the inbuilt insert row doesnt move it on to the next available row. Any idea what i'm not doing in between inserting rows?
    ViewObject vo1 = this.getmyVO1();
    vo1.executeQuery();
    Row newRow1 = vo1.createRow();
    newRow1.setAttribute("Staff Number","123456A");
    newRow1.setAttribute("Week_end_date", "2010-04-04");
    newRow1.setAttribute("Date", "2010-04-01");
    newRow1.setAttribute("Day", "Sun");
    vo1.insertRow(newRow1);
    Row newRow2 = vo1.createRow();
    newRow2.setAttribute("Staff Number","123456A");
    newRow2.setAttribute("Week_end_date", "2010-04-04");
    newRow2.setAttribute("Date", "2010-04-03");
    newRow2.setAttribute("Day", "Sat");
    vo1.insertRow(newRow2);
    P.S Yes they are dates but i made them strings for the time being until i get this working thanks for noticing.
    Edited by: user13012264 on 20-Apr-2010 04:19
    Edited by: user13012264 on 20-Apr-2010 04:20

  • Creating master detail rows

    using adf/bc with jsf. I have defined a master detail relationship between two entities. This relationship is a composition relationship. The entities are related by a view link which link the master and detail view objects. i have a need to create/insert a master row and a detail row programmatically "on the fly" so that when the jsp renders, the user will see blank inputs for both the master and detail view objects. The problem is that the primary key of the master record is not known at creation time ( it will be entered by the user) and therefore the detail record cannot be created by the framework because of the unknown value of the parent's primary key. I was hoping the following section in the adf guide would eliminate my problem, but it doesn't appear to:
    This is from section 26.7.3.2 of the adf developer's guide
    Note: An alternative to the programmatic technique discussed
    above, which solves the problem at the J2EE application layer, is the
    use of deferrable constraints at the database layer. If you have control
    over your database schema, consider defining (or altering) your
    foreign key constraints to be DEFERRABLE INITIALLY DEFERRED.
    This causes the database to defer checking the constraint until
    transaction commit time. This allows the application to perform DML
    operations in any order provided that by COMMIT time all appropriate
    related rows have been saved and would alleviate the parent/child
    ordering described above. However, you would still need to write the
    code described in the following sections to cascade-update the foreign
    key values if the parent’s primary key is assigned from a sequence.
    This approach did not help in allowing me to create the detail record without first knowing the value of the parent's primary key record in a composition relationship. The only thing i've found to work is define the relationship as just an association, and not a composition. However, this is a true one to many (composition) relationship and i would like to take advantage of some of the features of the framework that are there when a relationship is defined as a composition relationship. Is there any way to do what i need to do with a composition relationship defined between these two entities? Thanks.

    Hi,
    I guess you need a "Cascading LOVs".
    1) Create viewObject for country values list. Named VO1.
    2) Create viewObject for state values list. Named VO2.
    3) Create view criteria for (bind variable) VO2 which can restrict the result by country.
    4) Create view accessor to get VO1.
    5) Create view accessor to get VO2. Define the bind variable value which can provide country info dynamically. I guess it should be a Groovy expression.
    6) Create country LOV on step 4) view accessor.
    7) Create state LOV on step 5) view accessor.
    Done
    On the view layer, you may enable PPR between country and state attributes.
    Todd

  • Detail rows not fetched in af:iterator for the first time

    Hi,
    I have a table with 3 columns. Column 3 is a detail record with column 1 being the parent.
    Column 3 is displayed in the table using af:iterator #{row.detailRows}.
    The detail records are created in a different page.
    When I add the detail records to the master in this page and navigate to the page where the table is rendered, sometimes I do not see the column 3(detail rows) displayed immediately. The iterator #{row.detailRows} returns no rows.
    When I go back to the previous page wait for sometime and navigate to the page with table, I see the detail rows.
    This is happening intermittently and not always.
    Why is the iterator returning no rows sometimes(even though it returns values after a while)?
    When this happens, I checked the back end data and all the data is inserted into the db tables immediately.
    Jdev version: 11.1.1.4.0
    Any help is appreciated.
    Thanks!

    Srini,
    Should I set the 'Target Data Source' to the detail iterator?
    I want detail rows displayed in column 3 for all rows in the table on page load, not on row selection.
    The page on load should display the table in below manner, irrespective of row selection all rows' detail values should be rendered.
    S No.
    Master key
    Detail values
    1
    master1
    detail1-1
    detail1-2
    detail1-3
    2
    master2
    detail2-1
    detail2-2
    detail2-3
    detail2-4
    3
    master3
    detail3-1
    detail3-2
    detail3-3
    Thanks!

  • Create New Detail Rows

    I have a jsp page with Master-detail tables. My current create new row button has to set current on one detail row to be able to create a new row. I have some master rows have no detail items. So my create new row button won't show up.How can I create a new detail row without setting a current. Thanks!

    I current have a create button goes with each detail row as href="browseMD.do?event=setCurrentRowWithKey&Arg0=<c:out value='${Row.rowKeyStr}' />&event=Create"
    I tried to drag 'Create' from the datail table DataControl->Operation->Create, but it won't work if I don't setCurrentRowWithKey.
    When I have only one table, I can 'Create' without setting current row on a view object. But the master and details seems to act differently, I couldn't make it work. Have you done any create new row with a master-datail view object?
    I'll try to work around with your 'dummy' row suggestion. Thanks!

  • Refreshing ViewLink Detail Rows data

    I have a JDev 9.0.5 JClient application that uses a Master/Detail pair of ViewObjects thru a ViewLink. I update some columns on those ViewObjects using a right-click context menu that launches a modal dialog. When an data is changed that is reflected in the Master ViewObject, the data is automatically refreshed on the UI for the user to see. However, if I change any data that is reflected on the Detail ViewObject, the change is not visible to the user until I commit, and change the row currency on the Master VO. How can I get the changes to be reflected to the user immediately? What I'm looking for is something like a method on the ViewLink that would tell it to refresh the Detail window using the current Master row's key values. Does anyone know of a way to accomplish this?
    Thanks,
    Mark Brown

    Srini,
    Should I set the 'Target Data Source' to the detail iterator?
    I want detail rows displayed in column 3 for all rows in the table on page load, not on row selection.
    The page on load should display the table in below manner, irrespective of row selection all rows' detail values should be rendered.
    S No.
    Master key
    Detail values
    1
    master1
    detail1-1
    detail1-2
    detail1-3
    2
    master2
    detail2-1
    detail2-2
    detail2-3
    detail2-4
    3
    master3
    detail3-1
    detail3-2
    detail3-3
    Thanks!

  • No. of Detail Rows

    Hi,
    A challenge for you all!
    I am building a product details system in Portal forms.
    One of the screens is a Product Ingredients form with Product as the master block and ingredients as the Detail block. There can be between 1 and 20 ingredients in any 1 product and as these all have to sum to a volume percentage of 100% the client would like to see all ingredients for a product on 1 screen and not have to do Next/Previous to see them all.
    As you increase detail rows on a master detail form the performance of the form decreases dramatically so I would like to minimise the number of detail rows displayed for each product to maximise performance.
    To this end I wish to dynamically modify the number of detail rows displayed to match the number of ingredients on a product as that product is queried.
    I can handle figuring out how many rows I want to set the page to but have not been able to figure out how to change the number of detail rows displayed at run time.
    Anyone know how (or if!) this is possible ?
    All help gratefully recieved
    Andy

    Hi,
    You can only specify the number of details rows at design time. There is no option to change it at run time.
    Thanks,
    Sharmila

  • Dynamically modifying the number of Form detail rows

    Hi,
    A challenge for you all!
    I am building a product details system in Portal forms.
    One of the screens is a Product Ingredients form with Product as the master block and ingredients as the Detail block. There can be between 1 and 20 ingredients in any 1 product and as these all have to sum to a volume percentage of 100% the client would like to see all ingredients for a product on 1 screen and not have to do Next/Previous to see them all.
    As you increase detail rows on a master detail form the performance of the form decreases dramatically so I would like to minimise the number of detail rows displayed for each product to maximise performance.
    To this end I wish to dynamically modify the number of detail rows displayed to match the number of ingredients on a product as that product is queried.
    I can handle figuring out how many rows I want to set the page to but have not been able to figure out how to change the number of detail rows displayed at run time.
    Anyone know how (or if!) this is possible ?
    All help gratefully recieved
    Andy

    The rownum pseudo-column hold the number of the row but it doesn't work like you expect. It is assigned before sorting for example and it is not absolute. SQL conceptually deals with sets and sets have no inherent order. See http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    If you want to have an absolute number in a row you will need to maintain it yourself with PLSQL code.

  • Problems with Master-Detail Form not retrieving Detail Rows

    Portal 3.0.7.6.2 on NT
    I am having problems with a Master-Detail Form not retrieving Detail Rows. Sometimes it retrieves all, sometimes about 50%, the majority of the time it's not retrieving any. If it never retrieved any I would suspect that the 'join' condition was wrong but that isn't the case. I didn't have this problem with a prior MD Form I created. I have tried re-creating the MD Form but I get the same problem.
    Is anyone having similar problems/is this a know bug??
    Any help or thoughts are appreciated.

    I experienced performance problems. The simpiest MD form takes about 10 secs. to requery. I's not answer to your question, but there is more problems with this concept.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Michael Finch ([email protected]):
    Portal 3.0.7.6.2 on NT
    I am having problems with a Master-Detail Form not retrieving Detail Rows. Sometimes it retrieves all, sometimes about 50%, the majority of the time it's not retrieving any. If it never retrieved any I would suspect that the 'join' condition was wrong but that isn't the case. I didn't have this problem with a prior MD Form I created. I have tried re-creating the MD Form but I get the same problem.
    Is anyone having similar problems/is this a know bug??
    Any help or thoughts are appreciated.<HR></BLOCKQUOTE>
    null

  • Master-Detail and Auto Insert Detail rows

    Apex 3.0
    I'm trying to do a Master-Detail form. I have it set to stay on the same page when I Create a new Master Record.
    Now, what I would like to do is auto insert data into the Detail Rows some predefined information and have it ready for the user to enter the rest of the information. I did this by creating a Page Process to trigger on the Add Row button for the Details region. The code I used is:
    begin
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'General');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Automobile');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Excess');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Workers Comp');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Others (Builders Risk)');
    end;
    P7_Contract_ID is the PK on the Master table and I predefine the Insurance Type. The rest of the table the user is able to enter as needed.
    When I run it, the new rows show up but the Insurance Type is NULL and browsing from one record and back the new rows are gone. It seems like the PK for the Detail rows are not being filled. I have a Sequence Trigger set to fire on Update:
    CREATE OR REPLACE TRIGGER "BI_PURCH_INSURANCE_TYPE"
    before insert on "PURCH_INSURANCE_TYPE"
    for each row
    begin
    if :NEW."INSURANCE_TYPE_ID" is null then
    select "PURCH_INSURANCE_TYPE_SEQ".nextval into :NEW."INSURANCE_TYPE_ID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_PURCH_INSURANCE_TYPE" ENABLE
    What am I missing? Any ideas or suggestions?

    Hi All!
    I think there is no solution to this problem, only single selection is the solution.
    If any one has anyother solution plz let me know.
    Thanks and regards.
    Abbasi

  • Master detail forms..increase the detail rows by clicking a button

    hi all,
    i have a problem, in my master detail form i have set the details rows as 8. can i give an option to the user such as a button, on clicking which he can increase the number of detail rows by say 2 or 3.
    can any one help me out on this???
    Thanks in Advance
    Rajesh

    Hi Rajesh,
    This is not posible in the current model of the portal forms , the no of detail rows can be set only at the design time.
    rahul

  • Fixed number of detail rows

    Hi all,
    I have "shipment form" that I need to replicate in reporting services - see image.
    FYI, there is more header info below the "shipment details" section...
    My issue, is fixing the number of detail lines, my data can have between 1 and 5 detail lines & I would like to use a table rather than lists / textboxes etc.
    Is there any way I can fix the detail lines lines to 5 i.e. i need the shipment detail section to be the same size - regardless of the number of rows.
    I think one solution is do it in the query (return empty detail columns when they don't exist) - but I'm guessing there is a correct way to do it in the report.
    Any assistance greatly appreciated.
    Thanks in advance.

    Hi Clay,
    I am not sure if it's the cleanest option, but it works :-)
    In the query of the shipment details, add the following (assuming your query has just five output columns):
    UNION ALL
    SELECT '', '', '', '', ''
    UNION ALL
    SELECT '', '', '', '', ''
    UNION ALL
    SELECT '', '', '', '', ''
    UNION ALL
    SELECT '', '', '', '', ''
    ORDER BY ColumnName DESC
    This will add blank lines to your query. Now you have to tell the tablix that it should not display more than 5 rows. Right-click on the details icon on the left of the details row and select "Row visibility". Select the option "Show or hide based on an
    expression" and type the following in the expression box:
    =Iif(RowNumber(Nothing) <= 5, False, True)
    The added blank lines and this visibility expression should always create 5 rows.
    Hope this helps!
    - If a post answers your question, please click "Mark As Answer" on that post!

  • Show/hide detail row

    Carl:
    See http://htmldb.oracle.com/pls/otn/f?p=24317:6
    I modified your nifty example at http://htmldb.oracle.com/pls/otn/f?p=11933:1
    to use images instead of the show/hide detail labels.
    I had to make some minor mods to the code, but it works fine...for the most part.
    I used the option to show only 1 detail row at a time.
    If I click the show/hide images rapidly (actually I am not sure it is the rapidly part, haven't been able to reproduce it consistently), I end up with a situation where more than 1 detail row is visible at the same time.
    Can you please take a look and see if I am doing anything wrong?
    Thanks

    Mostly in IE, here is an example
    http://i3.tinypic.com/vo3bbn.jpg
    I am not sure of the exact sequence of clicks I did to land up at the screenshot, but I think rapidly clicking that show/hide image does it.
    Taking a look at the code
    function showdetail(t,i)The "t" that I am passing in to the function would be the IMG element in my case.
    I modified the Toggle function as
    function ToggleLabel(pThis)
            var l_show_img="/i/themes/theme_10/showhide_show.gif";
            var l_hide_img="/i/themes/theme_10/showhide_hidden.gif";
            var l_show_re=new RegExp(l_show_img+"$");
            pThis.src = (pThis.src.match(l_show_re)) ? l_hide_img : l_show_img;
    }where I flip the src attribute of the image.
    I am not sure what is wrong. If something were wrong, why would it work at all? Why would clicking stuff fast cause it to break?
    Thanks for any help.
    And I am not using AJAX at all, just your plain DHTML example at 11933:1
    Ah, I got it. Doing the following reproduces the bad state in both IE and FF consistently
    1. Launch the page in a new session
    2. Click the show/hide image on the first row to show the text
    3. Click it again to hide it
    4. Now click the image on the 2nd row.
    This shows the 2nd row's description...but it also shows the first rows description!
    Any idea why?
    Thanks

Maybe you are looking for

  • [solved] Xorg 1.6 segfault

    Since xorg-server 1.6 was released, X has been dying on me... I believe I can always reproduce this by switching to a virtual console and back to X.  Once X dies, it's pretty much over; computer won't respond to anything except magic sysreqs. Apr 13

  • How to install adobe in mac book pro

    i need help installing adobe on mac book pro

  • Photoshop_13_LS16.dr not recognized

    In the adobe download assistant I get the message: Photoshop_13_LS16.dr not recognized It is in the extracting part and it's not going anywhere. how can I clear this and start over?

  • DWCS4, form

    I have a simple formmail form using a cgi script. Works fine, with one minor problem... All my pages have simple "wrapper" to contain content in the center (790px wide). In all browsers I tried (IE, safari, opera) except Firefox 3.0, all of my pages

  • GarageBand 10.0.2 will not open on MacBook Pro 15-inch, Early 2011 running OSX 10.9.5. w/ 8 GB RAM and 1 TB SSD Samsung 840 EVO.

    GarageBand 10.0.2 will not open on MacBook Pro 15-inch, Early 2011 running OSX 10.9.5. w/ 8 GB RAM and 1 TB SSD Samsung 840 EVO. Have deleted (secure delete) and reinstalled several times. Got it to open once right after download... Usually crashes/h