Master Detail questions.

Couple of questions around master/detail screen.
I have all the necessary EO/VO/Links etc set up.
The master is a simple messageComponentLayout with a primary key.
The detail is an advanced table with a primary key.
The links are from primary to foreign (altho not defined as such in database).
When I render the screen my primary key in the master is populated through code in the controller.
I have initialised both the the VO's (master and detail).
Here is where I think the problem is. The master looks fine when I render, however the detail queries back what is in the database (all records plus a new one!!).
When I save the master is created correctly but the detail has no foreign key populated and no primary key populated.
Questions are.
1. How do I prevent all the detail records being displayed.
2. How does the foreign key column get populated, I hoped it would be automatic from the master/detail relationship.
3. How does the detail primary key get populated. I appreciate I have to code this, where should this be done and when? i.e. at apply or render?
Regards
Robert

Robert,
in your page design, is user forced to make master record first? Or are you inserting both master and detail rows together in DB? If my first statement is true, how are you populating primary key, is it a sequence?
Ideally page design should force user to make master record first. Once this is created you have to write code to get the foreign key from the newly created master record and populate the detail records with same forign key.
--Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Master Detail Question

    I have two questions that deal with a wizard generated master detail form/report. The form has the master and detail forms on the same page.
    1. When adding a row to the detail table is there a way to have it automatically fill with the values from the previous row?
    2. I added the following javascript code onBlur="javascript:{this.value = this.value.toUpperCase(); }" to the Element Attributes of one of the detail form fields to force it to upper case. It works fine as long as the field is defined as a text field. If I change the field to a Popup LOV the functions no longer works. Is there a way to have both the Popup LOV and the javascript?

    Michael...
    Not truly an answer... I'm a 'newb' with just enough experience to put his foot in mouth. Here is my thinking about your questions.
    Q#1: I don't know.
    Q#2: The script is on detail page and runs when object loses focus. LOV is separate object and knows nothing about the script. My approach: Go back to table (serving as basis for LOV) and change entries to use 'caps'. If this isn't practical, use your script in the onLoad event for the Popup LOV. (Note: I haven't done this. It just 'makes sense'. Now THAT is a phrase that will get ya in trouble!)
    FWIW...
    gary b

  • Master Details Questions

    Hi all,
    i need to create master details of p.o. entry jsp web application. can u tell me jdeveloper 10g can do it ?
    (my meaning of master details is dynamic insert new
    record at detail scope at same page . no need link to
    another page. idea like oracle9i forms.)
    best regards
    boris

    Neon wrote:
    I have mapped a createInsert action in the blinding layerThis is OK.
    Neon wrote:
    Do you mean that i have to create createRow and insertRow action in blinding layer?No. The createInsert operation does just that
    Neon wrote:
    Or call these function in the VO overridden create() method?No. You can't do that.
    In conclusion, I don't understand why the accessor returns null. Maybe someone else can shed some light... ?:|
    One last suggestion from me is to try getting the VO1 directly from the AM instead.
    This should work - it is not a recommended practice through.
    Use the following code:
    VO1RowImpl vo1 = (VO1RowImpl)this.getVO1();
    // ensure that the VO1 VL accessor is properly initialized
    if (vo1 == null) {
       vo1 = (VO1RowImpl)((YourApplicationModuleImpl)this.getApplicationModule()).getVO1().getCurrentRow();
    }

  • Question on master detail coordination

    Hi,
    Kindly help me with the following question.
    If a master details is waiting on its Wait for Flow activity, and it has previously spawned few detail processes, what happens when one of the detail processes at runtime didn't execute the Continue flow activity but completed successfully(for example .. due to a comparison activity) and other detail processes executed the continue flow activity and completed successfully?
    Thanks,
    Srini

    Hi,
    I've answered your duplicate post on the Workflow FAQ forum at http://smforum.workflowfaq.com/index.php?topic=599.0
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Question on "Master Detail page using ADF" sample

    I downloaded the "Master Detail page using ADF" sample application. I modified editDepartment.jsp page to include the Commit button as follows:
    <html:submit property="event_Commit">Save and Commit</html:submit>
    When I go to edit a department record and click on the new "Save and Commit" button, I SQLed the DEPARTMENTS table and noticed that the edits were not commited. I also restarted the embedded OC4J server and still get the same results. For some reason, the department view object contains the modification but the entity object doesn't. Why?

    Scott,
    My colleague suggested a workaround, which is to explicitly include the detail table's id in the master table's partialTargets list. So, for example, in MasterDetailDP.uix, changing:
    <table model="${bindings.DepartmentsView1}"
           id="DepartmentsView111"
           partialRenderMode="multiple"
           partialTargets="_uixState">to:
    <table model="${bindings.DepartmentsView1}"
           id="DepartmentsView111"
           partialRenderMode="multiple"
           partialTargets="_uixState EmployeesView312">...will cause the detail table to be updated when sorting the master table.
    There is some question about whether sorting a table should actually cause the currently selected row to change - we're still discussing this point.
    Andy

  • Question of displaying Task Flow Region in Master-Details pattern

    We have a master-details page. There is a region on the details pane along with other widgets and the content of that details pane including the region depends on the row selection on the master table list.
    The first time page loads with no row selection on master table so this details pane displays nothing. When I select one row on the master table and the details pane and its region can display data of the row in master table properly.
    After several selection, I navigate to another page and then go back to this master-details page again, it automatically selects the row which was selected last time. And in the details pane, the region whose content was created basing a task flow call cannot display corresponding data of the default selected row while other widgets in the details pane can display corresponding data properly.
    The reason of having this problem is the region's parameter is generated before the selected row is determined. When the task flow call in page definition is parsed, the parameter of this task flow call is created before component binding of the master table. It means when the task flow call is parsed and generating the parameter, the ADF page believes there is no row selection of the master table because the component binding is null at that time.
    So my question is how to make the this task flow call for that region create the task flow call parameter after the component binding of the master table? Or is there any way to force a refresh of the region/task-flow-call after the render of response? Or is there anyway to disable this "auto-select" on the master table after navigating to other page?
    (My jdev version is JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1 )
    Edited by: user790224 on Sep 6, 2012 4:16 PM

    The reason we are using master-details patter here is it is designed in that way and the region is displaying the data of a selected row there.
    There is no master-details relationship on model layer. But the content of the region is from the result of several other Java API calls which call the task-flow from an external component.

  • 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.

  • Questions on Master-Detail HTMLDB HOW-TO

    Hi all
    I have created a 3 page application based on the master detail how-to given at http://www.oracle.com/technology/products/database/htmldb/howtos/index.html
    Instead of DEPT and EMP tables I have PERSON and PERSON_ADDR tables. The PK of PERSON is the person_id and the PK of PERSON_ADDR is the person_id and addr_start_dt. Person_id column in PERSON_ADDR is obviously the FK to the master table PERSON(person_id).
    At first I had problems trying to create the pages themselves because the wizard always hides the person_id column on all the forms(and I don't want that,even though it is a sequence number I still want people to see it) , it being the PK, then somehow I managed it to display the person_id by replacing the EDIT link with the person_id itself. Now if a person already has an address and I click on EDIT then it copies the person_id values and others to the next page and all looks good but when I try to create a new address it does it ?? (It should take across the person_id as well)
    My PERSON report is on page 1, when I click edit against a person it takes me to page 2 where I can see+change all the person details plus I can see the person_addr details. When I click edit against a person address it takes me to page 3 and I can edit all the address details nicely copied to the new page but when I click CREATE on the page 2, then all the fields appear as NULL on page 3( all the fields but the person_id should be null here). How can I fix this ?
    Also, for my person address I would like to validate the address dates , there should be no overlapping start and end dates for a person's address. How to do this ? I think I will need to create a function to which I pass the person id and the new start and end dates and this function returns error message,if any, or null. I had a play around with validation and I think I need to use "function returning error text", what should I put in the "validate expression 1" box then...just something like
    begin
    my_function(param_1,param_2)
    end;
    If yes, then what variables would store the new start date and new end date of an address.
    Lastly, for every table do I have to user a sequence number or a trigger to define a primary key, what if the primary key is just a character code and I want the users to add it ?
    Thanks a lot in advance !!

    thanks Marc.
    Yes you are right, I used the 1.5 viewlet. I will try the master-detail wizard now.
    With the primary key problems, for things to work nicely in HTMLDB, do you suggest each and every tables should have a sequence number generated primary key ? We have some tables for various statuses like ACTIVE,CLOSED where these codes themselves are the primary keys, so you suggest making these codes unique keys but still have a sequence number PK ? Also when I want the users to enter the primary key themselves I will let them enter new ones but not update existing ones, so data entegrity is maintained.
    I was able to work out how to create validations using "functions returning error text" but my problem is I need to be able to compare what the user has just updated/entered with the data that already exists in the table. I have a table called person_Address having columns like person_id, start_dt,end_dt and various other fields. The primary key is person_id and start_dt and I need to put a validation which avoids any overlapping addresses. Overlap as in there can be only 1 active address for a given start and end date range. Does HTMLDB has something like :new.start_dt the way we can write database triggers ? Please suggest a way to do this.
    Lastly, how does HTMLDB handles error messages raised by table triggers. Can they be shown along with the item on the page as we can with the other HTMLDB validations ? I have many tables with all sorts of triggers and if any validation fails I generally do...raise_application_error(-20001,get_my_message(234));
    get_my_message function returns the message text for message number 234 . Will this message be displayed somewhere or not ? Do I have to duplicate my validations , once in the triggers and then in HTMLDB as well ?

  • Questions about master-detail update and delete!!

    I have created a view object with two entity objects.
    These two entity objects map master-detail tables in DB.
    I want to update both tables when the user input, and delete the record in detail table (keeping master table unchanged) when the user click delete button.
    How can I do?

    did you figure this out? i have created VO made out of two updatable EOs and update works fine. But still have issue with deletion!

  • Master Detail Form Question

    I would like to create a master detail form that is essentially 2 tabular report regions. Is this possible?
    Basically I would like to have region A that shows all of the relevant information for higher level items (there are multiple of these higher level items). I would then like to have region B which would show me all of the lower level details for the higher level item that was selected in region A. Is there a way to read the row that you are on in region A and only show those related items in region B?
    Thank you!
    Amber

    Are you asking to create two tabular reports on one page (Reports that are editable), or do you just want two reports on one page (non editable) where you select a row in the first and the second displays the detail records of the selected row in the first, highlighting the the selected row in the first report?
    If you want the two editable reports, then the answer is no, you can only have one tabular form on a page.
    If you only want two reports, or perhaps the top report as a non editable report and the second as an editable report, then it is possible to do this.

  • Question on triggers in master-detail from

    I'm a bit confused on what triggers will fire when in master-detail as follows:
    If I understand correctly the post-query trigger in the master block will fire during query processing for each record, but not again when you use previous record or next record, unless the record needs to be fetched again.
    In the detail block, are the records fetched each time, and post-query trigger fires, for a new instance of the master record or only once the first time they are queried? In other words, is the execute_query built in executed each time for the detail block when there is a new instance of the master record.

    Never mind, found my answer.

  • Apex 2.1 (XE) Master/Detail Page Question Regarding Prev/Next Buttons

    When creating a page of type master/detail the master form is auto-populated with two buttons that allow the user to navigate to the previous or next record. These buttons are implemented as submit buttons, which cause the session variables to be updated with the current form values prior to moving to the previous or next record. But no database update happens because the buttons have matching before computation branches that reload the current page. It seems to me as if these buttons should have been implemented as URL redirects so as to not cause the session variables to be updated, especially since they are being updated to values that will not match the newly displayed record. And another problem is that any user changes to items on the form get picked up by the page navigation submittal and are stored into the session's item variables, yet are never persisted to the database. When code on other pages use these item variables, you can get some strange results because of this.
    My current workaround is to store each displayed item into the session during the display of the page (during the rendering phase) using the htmldb_util save_session_state function. This effectively overwrites any errant data in the session variables with what is actually being shown on the screen. (As an aside, if anyone has a better way to cause all the session variables to be updated during the fetch and page rendering step, please let me know, otherwise I will continue hand coding the save_session_state for each item in an anonymous PL/SQL block).
    Ultimately I was wondering if anyone else thought these two buttons should have been implemented by the Apex designers as URL redirects, rather than submit buttons? This would have kept the session data update from happening. Or is there a good reason to have these buttons submitting that I haven't been able to figure out?
    Thanks in advance for any thoughts on the issue.
    - Jim

    Is a before insert trigger not more interesting and safer in your use case?

  • Parameter on Master Detail Form

    How do I set a bind variable in a Master Detail Form?

    I suspect that he may have the same question I do. Namely, if I have four tables (employees, projects, tasks, and project_assignments) how do I create a master detail form where I can specify the project and the employee via LOVs? The project_assignments table contains foreign keys for employee, project, and task, as well as additional fields relating to the task status.
    Currently, I have it set up so that the employee name can be selected and the project is hard coded to the current project.
    Is there an easy way to populate the detail records based on two LOVs in the master form?
    Thanks in advance,
    Fritz

  • 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-details problem: How to access the parent EO/VO in child side?

    Hello
    Refer to the reply of posting
    Re: How to insert  new records in Master and detail Forms.
    I have got the following questions
    The approach for setting the master-details relationship works well, however, in this example,
    I have overriden the create(AttributeList attributeList) method of VO2, so after calling
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    , it will enter the create() method of VO2, at this point, i can only access the argument attributeList
    which stored the key value that link up parent and child, however, how can i get the entire VO1
    for accessing the value of all VO1's attribute?
    Thanks

    Neon wrote:
    I have mapped a createInsert action in the blinding layerThis is OK.
    Neon wrote:
    Do you mean that i have to create createRow and insertRow action in blinding layer?No. The createInsert operation does just that
    Neon wrote:
    Or call these function in the VO overridden create() method?No. You can't do that.
    In conclusion, I don't understand why the accessor returns null. Maybe someone else can shed some light... ?:|
    One last suggestion from me is to try getting the VO1 directly from the AM instead.
    This should work - it is not a recommended practice through.
    Use the following code:
    VO1RowImpl vo1 = (VO1RowImpl)this.getVO1();
    // ensure that the VO1 VL accessor is properly initialized
    if (vo1 == null) {
       vo1 = (VO1RowImpl)((YourApplicationModuleImpl)this.getApplicationModule()).getVO1().getCurrentRow();
    }

Maybe you are looking for

  • Search Never Finishes in IE

    Hello everyone, I have a set of files given to me by one of our Engineers. I understand they built these help files from our regular .hlp files. It appears they were built using DHTML. opening a local copy of the html pages the search tab seems to wo

  • Getting Audigy Ex Platinum back into Digital out mo

    OK, I rebuilt my computer this weekend, and one problem remains. Everything worked fine before with my Audigy and Klipsch 5. system, running in digital mode. Everything is installed (physically) the exact same. I CANNOT for the life of me get the aud

  • Oracle Procedure Question - Subquery

    I have a procedure that I invoke from Java, it does work properly, I would like to add two additional columns to my resultset, namely; legal_entity_id and legal_entity_name, I have written the subquery to extract the two additional columns but I am h

  • NqsError 75027 in 11.1.1.6.2

    I'm having a really odd experience with my Alerts. I configured my SMTP settings, created an alert, and ran that alert. It worked. I received an e-mail. I kept testing it, running that same alert several times. It ran successfully 4-5 times in a row.

  • Need help understanding how ipv4 and ipv6 co-exist

    I'm trying to understand something that happened in our network recently. Current, we're all ipv4 based, but a few machines here and there have ipv6 enabled by mistake. Everything has been working ok, but recently we had some dhcp issues. I'm trying