Master Details Population

Hi All
Question
I have a master detail form For eg. dept and emp tables.
Both my blocks are multi record blocks.
I enter one record for master block and then click on detail block and enters its corresponding rows.
Then I try to enter the second record in master block.
What happens is , it pops up a question asking me whether I want to save the records.
Now my problem is -- I dont want this popup. But the records should get inserted (if not committed).
And I should be able to enter the 2nd row for master block and its corresponding details.
Also when I go up to the first record of master block it should show me the details of 1 record.
This I want to achieve so that I can commit all records of master and detail at once and not record by record.
My solution:
I have thought of using POST command and then populating the detail records using a cursor.
I can write this on "WHEN-NEW_RECORD_INSTANCE" trigger".
But this involves a lot of coding and I am not sure whether it will work fine under all circumstances.
ie . what if another user is updating /inserting/ deleting some record etc etc
Can anyone provide me a simpler/better solution.
Thanks in advance
Ashwin N.

Hi Duncan
Thats what I dont want to do .
I want to commit all my records at the same time.
Thats the reason I have replaced "ASK_COMMIT" with
"NO_COMMIT" and I am using POST to save the data .
But there a lot of problems.
Isnt there a simpler method ?
I mean cant I set any property at design time to make this work ??
Thanks
Ashwin N.

Similar Messages

  • Master detail populating

    hi guys, I was wondering if you could help me. Im not sure how to go about the following situation. Ill try to explain it as best I can.
    I have MASTER 1 populating DETAIL 1 and DETAIL 2. DETAIL 2 is also a MASTER(MASTER 2) of DETAIL 3. But my problem is that i need Detail 3 to contain all the record id's of DETAIL 1 and if detail 1 gets a new record added it automatically needs to be added to to MASTER 2.
    I know the above is very confusing and I probably dont make much sence, but if i do could anyone please help me out. basically if Detail 1 gets updated this update needs to also be added to a column in Master 2.
    Any help would be greatly appreciated.

    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>Announcement: Forums Etiquette / Reward Points
    </ul>
    It is always helpful to list your OS, Forms and Java version.
    I have MASTER 1 populating DETAIL 1 and DETAIL 2. DETAIL 2 is also a MASTER(MASTER 2) of DETAIL 3. But my problem is that i need Detail 3 to contain all the record id's of DETAIL 1 and if detail 1 gets a new record added it automatically needs to be added to to MASTER 2. To make sure I have this right, I'll try to draw a diagram.
    MASTER1
        |
        |                     |
    DETAIL 1          DETAIL 2 (MASTER 2)
                              |
                           DETAIL 3If a row is added to DETAIL 1, it also needs to be added to DETAIL 2. The best way to handle this would be a Before-Ins trigger on the DETAIL 1 table to write any new rows to the DETAIL 2 table. If you need this to be a Forms based solution, then you could add a Pre-Ins or Post-Ins trigger to the DETAIL 1 block that writes a row to the DETAIL 2 (MASTER 2) table.
    How are you handling the data coordination between your blocks? Are you using relationships defined between your Master and Detail blocks?
    if detail 1 gets a new record added it automatically needs to be added to to MASTER 2With a relatiship between the blocks, you don't have to write any code to coordinate the display of data between the blocks - the relationship handles this coordination.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Old items are not populated after adding items into a master/detail form

    Hi,
    I am relatively new to APEX. I am creating a master/detail form. It works well. When I add new items the older items are no more populated. Why ?
    For example I have an itme which is a select list as a Named LOV. At creation of the row I want the user to choose from this select list. It works well.
    But when modifying the record, I don't want the user to change this name. For that purpose, I create an item which is a display only item. This item is conditional and appear only when the record has been created.
    And this is where the problem comes. It seems to work but, if I logout of the application and login, then values are no more populated to the items and I get an error when trying to update the form.
    I hope I make it clear. I have been trying a lot of times and found that if I add items, then everything goes wrong.
    Thank you for your kind help.
    Christian

    Hi Christian,
    You don't say what the error is that you are getting - this may help us with your problem!
    On the form, do you now have TWO fields - one being the original select list and the other being a read-only version of it? Is it likely that BOTH fields could appear on the page at the same time AND that both are connected to the field on the table?
    You can set the select list to be read-only conditionally - in this case you could make it read-only on the condition of the primary key field not being null.
    Andy

  • Master-Detail Forms (Populating a Foreign Key Automatically)

    Master-Detail Form
    When inserting a MD Form, the Master ID (e.g. Deptno,the Primary Key) is generated.
    How is it possible for this also to be generated in the Detail Form (as the Foreign Key)? The requirement is for the foreign key to be populated automatically.
    Any help would be much appreciated.
    Thanks.

    This item is discussed earlier in this group.
    It's solved in version 3.0.8
    Regards,
    Anna

  • Master-detail form not populated

    Hello,
    i have created a data block on my ELEVI table, and then another data block on ELEVI_CLASA table, table which contains (id_elevi, id_clasa, start_date, end_date). at Master-Detail section i have specified the join condition,
    ELEVI_CLASA.ID_ELEVI=ELEVI.ID
    in the WHEN-NEW-FORM-INSTANCE trigger i have
    begin
    go_block('elevi');
    execute_query;
    end;but the block ELEVI is populated, without being populated ELEVI_CLASA too (that 4 fields).. when i run the form it points to the first item from ELEVI_CLASA and tells me that "Field must be entered". Why happens this?
    Thanks

    Sorry if i'm asking this, but how should i see that last query? when i created the second data block, ELEVI_CLASA, in master-detail section i joined these 2 tables, ELEVI and ELEVI_CLASA

  • Master/Details Relationship using View Links is not not population data

    Hi,
    I have problem in generating proper data in master/detail relationship using view links passing three parameters between two custom tables can guide me the steps and process how i will able to generate and acheive this requirement.
    very urgent
    Please suggest me

    Without further details, I'd suggest reviewing the following Section of the Fusion Developers Guide:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/web_masterdetail.htm#ADFFD758
    I've done this many times without issue.

  • Multiple master blocks populating the same detail blocks

    Hey guys. Im doing something a little weirder than I usually do but I can't get it to work correctly and im wondering if any of you have accomplished this before.
    I have a call center application which processes applications by either the application or by follow up. The application and follow up are each a block by themselves located on a separate pages on a tab canvas. Both these blocks are master blocks to the detail blocks which would be user_phones, user_addresses, user_bank_accounts, etc. The idea is I can use either page of the tabs and flip through either the follow up, or application master block and have it populate the user tables according to the user_id found on the master blocks. I figured I could use a when-new-block-instance trigger to switch off which block fires the on-populate-details trigger.
    The problem is.... complicated. If I go to the follow up block and execute query, it brings back the right information on the detail block. The strange thing is it seems like when I move the cursor to a different record on the same block, forms is almost setting a SET_BLOCK_PROPERTY DEFAULT_WHERE action. This is un-noticeable until i go to the other master detail block. When I start using the applications block, it seems like all the detail records actually MATCH the user_id that the cursor was on in the follow up block...
    phew! thats a lot of description for such a strange problem..
    Anyways. Anyone encountered this before? Has anyone ever built a two master block form to populate the same detail block? Is it possible? I haven't found a thread in the forum about this subject..
    Any help would be great. Thanks in advance :)

    Having one detail block for two master blocks was never a use case that we considered for Forms. It sounds like you are trying to make a many-to-many relationship work with two master blocks. I suggest you think about having an intermediate block (hidden or not) that drives the detail block and make each master block drive that intermediate block instead of driving the detail block directly.

  • Problem on Master Detail CRUD

    Dear All,
    I am trying to figure out how ADFBC handles Master Detail relationship as this
    is the first time where I need to handle table relationship.
    From practice, I only used one table but this time I need to manage the relationship also.
    I have two tables below. They have a one to many relationship.
    PART_ID in the PARTS_CODE table is populated by a DB sequence.
    PARTS_CODE                                   PART_DESC
         - PART_ID (PK)                              - PART_ID (PK)
         - RANGE                                   - REGION  (PK)
         - CATEGORY                              - DESCUse Case is like this:
    PARTS_CODE table holds the data on the parts while PARTS_DESC holds the information on the Region specific description of the parts.
    Now I created a View object that joins the two tables. Then I drag this View Object from
    my Data Control as an update-able table.
    I just have some questions on the implementations:
    1. When I drag the CreateInsert button and click it, I notice that it adds a new row to the
         table but I notice that it creates Input Text component only on the columns associated with
         the PARTS_CODE Table, the other columns for the PART_DESC does not have any UI components.
         How to solve this?
    2. How can I manage the relationship such that when it inserts the data on the PARTS_CODE, I need
         to get the DB sequence generated number and insert it into the PART_DESC table
    3. Any demo/links that shows CRUD operations that involves master detail tables?
    I have searched the forum for Master-Detail Crud but I only see how to display the relationship and not
    the CRUD operations.
    Found this blog also http://andrejusb.blogspot.com/2009/03/create-operation-for-master-detail.html but
    I am having trouble fully understanding it yet.
    JDEV 11G PS3
    Thanks

    Hi,
    Which of the following is your case scenario?
    1) By pressing CreateInsert, You want to have one new row with data from both tables?
    For this, You should make the reference entity to be updatable. You will find the property in the Entities level of your View Object. By creating at the same time, you have to handle the PK properly. Especially if there is a change to the PK of the master entity.
    2) Do You want to have two createInsert Buttons and press them in order?
    You have to follow the view Link
    Regards,
    Dimitris.

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

  • Error while saving data in master detail

    Dear all
    I'm new with ADF
    I have created master detail page
    master table is departments
    detail is Employee table
    The scenario is:
    Insert a record in Department
    Then insert another record in the details for an employee
    press save
    error Attribute DeptId in MyServices.EmployeesVO1 is required
    The primary key in both department and employee are sequence and are populated from a database trigger.
    please help
    note : adf 11g and jdeveloper 11.1.4
    Edited by: ta**** on Apr 13, 2011 12:54 PM

    you can try the followings:
    If you have a control on your data base, then you can change the FK constraint to be DEFERRABLE, thus the FK value will be checked after commit,
    I used this method once and it it works fine.
    to alter your FK to be DEFERRABLE
    check this:
    http://infolab.stanford.edu/~ullman/fcdb/oracle/or-triggers.html#deferring%20constraint%20checking

  • How to determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

  • Refresh problem by combination of programmatic view and master-detail page

    I am using the latest versions of both ADF (10.1.3.2.0.4066) and JHeadstart (10.1.3.1.26) and I have an application with 1 page in which I have as root page a programmatic view (table-form) which I fill with request parameters.
    Under that programmatic view I have a master (table) with 3 detail pages (table).
    The programmatic view is populated with always 1 row, which goes always correct.
    The problem is occuring when iterating through the first entity based master table which contains lots of rows. Then the problem is that when you navigate through the master table the detail pages are refreshed correctly, but when you navigate back to the first row that row won't get updated.
    The next thing I tried is create a new jheadstart application with only the master-detail pages (entity based), so without the programmatic view, and then the iterating through the master table and the refresh of the child tables is working correct.
    What can be the problem here.

    Have you tested this in the ADF Business Components Browser? That's the tester that you can find by right-clicking your ADF BC Application Module and choosing Test. If you go to the View Object instance for the programmatic view, and using the ViewLinks to its children, do you get the same behavior as in the JHeadstart application?
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Master - detail

    Hi all,
    I did search for master detail posts, but didn't find what I was looking for. So if you feel that this has been answered a long time ago...don't hesitate to point me to those posts :-)
    This is for a home-project so...no pressure, but I can't get it working so .... here is it :
    In a web application (JSF 1.2) (visual java server faces)
    I have a table with master data :
    content.jsp
    <webuijsf:table augmentTitle="false" binding="#{content.content_tb}" id="content_tb" style="left: 24px; top: 96px; position: absolute; width: 0px" title="Table" width="1100">
        <webuijsf:tableRowGroup binding="#{content.content_rg}" id="content_rg" rows="10" sourceData="#{content.contentDataProvider}" sourceVar="currentRow">
            <webuijsf:tableColumn headerText="id" id="tableColumn1" sort="content.id" width="100">
                <webuijsf:hyperlink actionExpression="#{content.content_id_hl_action}" id="content_id_hl" text="#{currentRow.value['content.id']}"/>
            </webuijsf:tableColumn>
            <webuijsf:tableColumn headerText="naam" id="tableColumn2" sort="content.naam" width="100">
                <webuijsf:textField id="textField1" text="#{currentRow.value['content.naam']}"/>
            </webuijsf:tableColumn>
            <webuijsf:tableColumn headerText="categories" id="tableColumn3" width="100">
                <webuijsf:dropDown binding="#{content.dropDown1}" converter="#{content.dropDown1Converter}" id="dropDown1" items="#{content.categoriesDataProvider.options['categories.id,categories.naam']}" selected="#{currentRow.value['content.categories_id']}"/>
            </webuijsf:tableColumn>
    ...As you can see the first column in this table is the ID column which is a hyperlink.
    This hyperlink links to a detail page in which one can do updating to the content.
    The better part of this detail page is :
    Update.jsp
    <webuijsf:form id="form1">
        <webuijsf:hyperlink actionExpression="#{update_content.comasy_admin_hl_action}" id="comasy_admin_hl" style="left: 24px; top: 24px; position: absolute" text="Comasy_admin"/>
        <webuijsf:hyperlink actionExpression="#{update_content.content_hl_action}" id="content_hl" style="left: 120px; top: 24px; position: absolute" text="Content"/>
        <webuijsf:label id="label1" style="left: 24px; top: 0px; position: absolute" text="Comasy-admin"/>
        <webuijsf:button id="apply_bt" style="left: 23px; top: 48px; position: absolute" text="Apply"/>
        <webuijsf:label id="label2" style="left: 24px; top: 72px; position: absolute" text="Title"/>
        <webuijsf:textField id="title_tf" style="left: 120px; top: 72px; position: absolute" text="???????????????????????"/>
        <webuijsf:messageGroup id="messageGroup1" style="left: 408px; top: 24px; position: absolute"/>
    </webuijsf:form>
    ...My problem is now at the place where the ???? are.
    I want the textfield (title_tf) to be populated with the value which is in the cachedrowsetdataprovider for the particular row I clicked the hyperlink on.
    Do you have any idea what value expression I should use?
    I was thinking myself something like :
    "#{content.contentDataProvider.????????????}"
    Can someone point me into the rigth direction
    Best regards
    Martijn

    I solved the problem myself YIHAAA.
    Probably not the smartest way to solve it, but hey..it works and...I've got to learn somehow.
    In the end I didn't use value expressions (which I still think would be a more beautifull solution).
    When clicking the command_link I fill a proporty of the sessionbean whith the rowkey of the selected row. When JSF has navigated me to the detailpage I retrieve the value from the sessionbean. With the retrieved rowkey I can fill the other neccesary fileds in the detailpage in the _init() from the backing bean of the detail page:
    Master page conatains the following (action for the command_link):
    public String content_id_hl_action() {
            getSessionBean1().setContent4update(content_rg.getRowKey());
            return "case3";
        }detail page contains:
    private void _init() throws Exception {
            crsdp.setCachedRowSet((javax.sql.rowset.CachedRowSet) getValue("#{SessionBean1.contentRowSet}"));
            title_tf.setValue(crsdp.getValue("naam", getSessionBean1().getContent4update()));
            body_ta.setText(crsdp.getValue("body", getSessionBean1().getContent4update()));
        }thanx for thinking with me
    Regards Martijn

  • To get value in detail part of master detail form

    hi all
    i am using forms 6i
    there is a master detail form
    in the master part
    i am just mentioning one field as per the requiremnt
    FIELD BELONGS TO DATA BLOCK XXNP_JL_001.FIELD
    this FIELD field is populated by a flexfield NAP_GL_WELL
    VALUES are
    abc                           123
    def                            456
    fgh                            875
    in the master part of the form there is also a button called POPULATE which populates values  for the fields in the detail form
    in the detail part of the form
    i am mentioning two fields
    item_number belongs to data block XXNP_JL_EST_002 and      opn_value belongs to data block XXNP_JL_RES_005
    now the requiremnt is as follows
    say the WELL field has a value 'abc'
    then in the detail part
    whenever and only when the item_number is '1010103002' the opn_value field should have value 123
    similarly when the WELL field has a value 'def'
    in the detail part
    when the item_number is '1010103002' the opn_value  field should display value '456'kindly guide on how this can be achieved
    thanking in advance
    i did a when validate trigger on opn_value field
    BEGIN
    IF  :XXNP_JL_RES_005.OPN_UOM_CODE='PKU' and :XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_RES_005.OPN_VALUE
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
            END IF;
            END;Edited by: makdutakdu on Jul 4, 2012 12:40 PM
    Edited by: makdutakdu on Jul 4, 2012 1:05 PM
    Edited by: makdutakdu on Jul 4, 2012 1:09 PM

    HI
    If i understood your question on overview, your requirement is
    get master details in details column.
    If this is correct,
    YOu can write a simple plsql to get master value in details columne thru trigger
    If my understanding is not correct, please tell me

  • Master-Detail Form Questions

    Master-Detail Form Questions
    I have two questions in regards to master-detail forms:
    First, the form I am working on has 25 detail rows displayed to the user. If the user has more than 25 detail records for the master, I want them to be able to add more. For instance, after they enter the 25th record, I would like a pop up window to ask them if they would like to add more detail records for this master. If they select yes, then the records they have entered would be saved and then the form would repopulate with the current master record and another empty 25 detail records.
    Second, I would like the Detail Action to be set to Insert if the user moves to a new detail row and selects an item from a combo box.
    Thanks for any and all help.
    Jeremy.

    Hi Sharmila.
    Is there a way to repopulate only the Master information without populating the detail after the 'Save' button is pressed? I have written code that uses the session variables and repopulates the form with all the data that has just been saved, but I need only the master without the detail.
    Thanks.

Maybe you are looking for

  • How to delete projects from Vault

    Ok, here is the issue. I work remotely on a laptop and my main library and vault are on my home computer. I only keep the last couple of projects on the laptop and use the vault to backup those projects. I used managed files. When I get home from the

  • Customer  Open Item Analysis with Aging

    Hello, Our company currency is INR. Naturally many transactions will be posted with different document currency like USD / HKD etc. Now we would like see the outstanding of the customer with aging where the currency is Not Equal To INR Please suggest

  • Usage of BAPI BAPI_MATPHYSINV_CREATE_MULT

    Hi, I am trying to create Physical inventory documents using BAPI BAPI_MATPHYSINV_CREATE_MULT but its giving me error "Required function MB_PHYSICAL_INVENTORY not processed". Please let me know how should I use this FM. Thanks, Abhishek

  • Can't Download Music Without 7?

    I really don't want to download v. 7 because it says it's going to take like 4hours to download (i have slowwwww dialup) and i just don't have that time because it blocks my phoneline. Also, I've heard it's been screwing with people's computers and w

  • WHAT DO I NEED TO OPEN VINTAGE MANAGING YOUR MONEY ON MY MINI MAC?

    I have some financial files I need to access.  They were made on the old financial program, Managing Your Money. They are on 3.5 floppy disks.  I have a VST floppy drive but cannot find the driver, even if there is a way to access those files. Sugges