Insert Record in Master-Detail block

I am using JDev 10.1.2, Struts, ADF and JSP
I have a Master-Detail relationship. As the master table(Course) is browsed , the details(Students) record keep changing. Now I want to insert records to the detail (Students) block alone. I am generating the Students id using Sequence, but I want use the Course Id that is being browsed for the new record inserted. How do I do this.
I used the 'Read Only Dynamic Table' for the Details table and used the create button and forward it to create jsp. When I click on create button, it does go to the create jsp, but the the row is not blank. what do I have to do.
Any help will be appreciated.

Hi Shay,
Thanks for the response. At least I'm getting some response after so long a time.
I'm not sure what are you looking at. But this is what I have.
I have a browseCourse.jsp that displays the courses in the master and students in the detail. I have a create button for the detail, and my code looks like this.
public class BrowseCourseAction extends DataForwardAction
public void onCreate (DataActionContext actionContext)
actionContext.getHttpServletRequest().getSession().setAttribute("type", "create");
if (actionContext.getEventActionBinding() != null)
actionContext.getEventActionBinding().doIt();
actionContext.setActionForward("createstudent");
when the user click on create button it shows the createstudent.jsp. My question is how to set the course id for the new student that is about to be created.
What do I have to do for this?

Similar Messages

  • Insert record in master detail relationship

    Hi,
    I have the following situation. I have two tables (master and detail in 1:1 relationship). What I want to do is to skip through the master table and insert a record into the detail table containing only the id of the master table (foreign key column in detail table).
    My tables look like this:
    Master:
    ID
    NAME
    ADRESS
    Detail:
    ID
    DETAILS
    MASTERID (foreign key)
    For I am not experienced in PL/SQL does anybody give me an idea on how to do this. I think it is suitable to have a procedure solving this...
    Thanks in advance!
    Tino

    Here you go:
    CREATE TABLE dt_test_master
    (     id           number primary key,
         descr      varchar2(10)
    INSERT INTO dt_test_master VALUES(1, 'Master 1')
    INSERT INTO dt_test_master VALUES(2, 'Master 2')
    CREATE TABLE dt_test_child(id number, master_id number, col1 varchar2(10))
    alter table dt_test_child add constraint dt_test_child_fk_master
    foreign key(master_id) references dt_test_master
    CREATE SEQUENCE dt_test_child_id_seq
    CREATE OR REPLACE PROCEDURE p_CreateChild(     an_MasterId dt_test_child.master_id%TYPE,
    av_Col1          dt_test_child.col1%TYPE
    IS
    BEGIN
         INSERT
         INTO
              dt_test_child
              (     id,
                   master_id,
                   col1
         VALUES
              (     dt_test_child_id_seq.NEXTVAL,
                   an_MasterId,
                   av_Col1
    END;
    SQL> exec p_CreateChild(1,'Child1');
    PL/SQL procedure successfully completed.
    SQL> exec p_CreateChild(1,'Child2');
    PL/SQL procedure successfully completed.
    SQL> exec p_CreateChild(2,'Child1');
    PL/SQL procedure successfully completed.
    SQL> exec p_CreateChild(3,'Child1');
    BEGIN p_CreateChild(3,'Child1'); END;
    ERROR at line 1:
    ORA-02291: integrity constraint (TYLERD.DT_TEST_CHILD_FK_MASTER) violated - parent key not found
    ORA-06512: at "TYLERD.P_CREATECHILD", line 8
    ORA-06512: at line 1HTH
    David

  • Insert Record in Master-Detail by UIX Pages

    I am using Jdeverloper10g v10.1.2 ,ADF,UIX Pages
    My problem is :
    How i can insert a record by UIX Page , Because when i try to inserted a record by click on Create Button there is no action happen .
    So , is there any document can help me in Master_Detail_By_UIX
    with regards
    Naif

    Hi Leo,
    I know that but my application is already set up and I have all the reports and forms in place. However I do not know how to enter an update/insert statement when calling my form. I only can have update or insert.
    for update is working correctly and the reports/forms affected are quite complex I do not want to change anything on it but enter a detail recordset for each record in master table only containing foreign key id and id. then the update statement will work. At the moment I have to save the form (detail table) once to create th primary id and after that I can store values... but that is not feasible for end users...
    Tino

  • Inserting records in master detail form

    I am moving an existing Webdb Application to portal. In the application there is a master detail form along the following lines
    Dept Id: 10
    Dept Name: IMS
    Employee ID Employee Name etc
    1586 Julie Wilks
    Currently users can insert/update/delete detail lines. When inserting, the dept_id foreign key is automatically inserted into the dept_id column in the detail table. My understanding is that for some reason this does not happen in portal. Instead, the user is expected to input any foreign keys manually. As this could lead to all sorts of problems I'd rather not have to do this.
    Has anyone found a means to get around this problem?
    If solutions have already been posted, please point me in the right direction as a search on the forum hasn't come up with anything.
    Many thanks,
    Julie Wilks

    Hi,
    Am I the only one having this problem?
    Thanks,
    Diana

  • How to create Insert & Update on master-detail form JPA/EJB 3.0

    Is there any demonstration or tips how to Insert record on master-details form for JPA/EJB 3.0 with ADF binding?

    I have master-detail forms (dept-emp). I drag the dept->operations->create method to JSF page. But when I click create button, only dept form is clear and ready for insert. But emp form is not clear. How can I add create method for this?
    Can you give some example how to pass the right object to the persist or merge method so that it can save both the two objects (master-detail tables)
    Thanks
    Edited by: user560557 on Oct 9, 2009 8:58 AM

  • Master-detail Block save behaviour

    Hi,
    I have master detail block just consider Forms A as a master and Forms B as a Detail,when my cursor is in form A i try to save the record, it is saved Form A and putting Form B data as null, i have to put a validation to stop this activity, i have to inform the user "Provide values for form B text item",
    I created a post block trigger in form A
    Begin
    If (:FORM-B.TEXT1 is nul)l or( :FORM-B.TEXT2 is null)
    then
    Message( 'provide value for FORM-B');
    Message( 'provide value for FORM-B');
    raise form_trigger_failure;
    ELSE
    NULL;
    END IF
    END;
    Im Getting error message and navigation got stopped in last item of form A, please advice me which trigger i have to use for this.
    Thanks and regards
    karthik

    Hi
    Getting error message what is the error message ?
    to inform the user "Provide values for form B text item", Pls try to use WHEN-CREATE-RECORD or WHEN-validate-RECORD Trigger instead
    Besides raise form_trigger_failure;
    stops the navigation
    or to inform user and stop saving
    u can use pre-commit Trigger the raise form_trigger_failure;
    will stop saving...
    Regards
    Abdetu...
    Edited by: Abdetu on Feb 5, 2011 9:33 AM

  • URGENT HELP PLS :  Issue with Multi Level Master Detail block

    This is an issue someone else had posted in this forum few years back but there was no solution mentioned, I have run into this same issue , The problem is as explained below.
    Any help on this is appreciated.
    Scenario:
    There are 3 Blocks in the form : A (Master Block)
    : B (Detail of A )
    : C (Detail of B )
    There is master detail relation created between A and B and B and C. So initially when we query for a record in Master A, it shows all records properly in B and C.
    Now if i navigate to the first record of B , and then second record of B , records corresponding to that record shows up properly in C block.
    Till now everything works fine.
    Issue 1:
    But in case after querying initially on Master Block A,If I go directly to the second record of B block, it clears the whole B block and C block.
    Issue 2:
    Same thing happens if I am on C block ( corresponding to second record of B block) and then navigate to first record in B block , it again clears the whole B block and C block.
    Please Help !!
    Thanks !

    Thanks Xem for Your reply , I tried those settings but it did not help..here is the original link that to the thread that talks about the same problem ,
    Issue with Multi Level Master Detail block
    The last update to this was the following :
    "I figured out that this is happening because Block Status is set to 'Changed' and this is causing it to clear out the blocks.
    But cant figure out why the status is setting to 'Changed' "
    Any Help from the form Gurus on this form in this matter is truely appreicated !!
    Thanks,
    Zid.

  • Query based on a non-database item in master/detail block

    Hi,
    I have a master/detail block, and in the master the block in have non database control item which displays the user name. Now i would want to retrive all the master/detail records based on the control item. Is that possible? How can i do it?
    Any help would be appriciated.
    Thanks
    Kavitha

    use the set_block_property (default_where) and the execute_query built-ins. more info in the online help

  • Master/detail blocks problem

    hi friends
    i have a problem with master/detail blocks in my form.
    i have two blocks one is master and the other one is detail
    i made a relation between these two blocks
    and my form works corectly
    but when i am in enter_query mode ,my cursor cannot go to detail block.
    so i can't search special records in detail block.
    is there any way to search detail block's value in form builder?
    is it true that in master/detail blocks we can serach records only in master records?
    any help would be appretiated.
    regards,
    shoja.

    When a Block is in Query Mode the cursor is restricted to it - there is nothing to stop you from Querying the Master and then navigating to the Detail and going into Enter Query mode in that block afterwards.
    If you need to enter Query Criteria that applies to both the Master And Detail then you'll need to build a specialist query screen using a Non DB block that gathers all of the criteria and then uses SET_BLOCK_PROPERTY on both the master and the detail to define the required results.

  • Master - detail block (many-to-many)

    Hello, , I have 2 tables:
    1-(parts)its primary key : p_id
    2-(suppliers)its primary key : s_id
    and they have many-to-many relationship between them .
    the table Resulted from the relationship is(part_supp)
    How can I create master-detail block Based on this relationship.In other words, which of tables will be the master and which of them well be detail.
    I am using form 6i ..
    please help.....

    M3ATH wrote:
    Hello, , I have 2 tables:
    1-(parts)its primary key : p_id
    2-(suppliers)its primary key : s_id
    and they have many-to-many relationship between them .Many to many relation between two table isn't a good database design. You have to a junction table between them.
    the table Resulted from the relationship is(part_supp)Is this your junction table(part_supp) ?
    >
    How can I create master-detail block Based on this relationship.In other words, which of tables will be the master and which of them well be detail.If part_supp is your junction table between parts and suppliers then, try this..
    Use the junction table as a hidden block, then establish a standard Forms relation between
    Parts and (hidden)part_supp then between part_supp and suppliersHope this helps

  • LOV problem in Master-detail blocks

    Hi,
    I'm working with Designer 6.0.3.5.0.
    I've got a form with two master-details blocks :
    Block A
    |
    |||
    Block B
    |
    |||
    Block C - Lov D/E
    In my block C, i want to create two lovs (D/E).
    When i'am displaying the key item of the block (FK between C and the LOVs) and with the property "Enter FK with Descriptor"=NO. The LOV is OK on the key item and works correctly.
    But when i want to display only the descritor item (with the property "Enter FK with Descriptor"=Yes). The item is correctly displayed but without the LOV. If i open my module with forms, i can see that the lov is not built.
    Does somebody know if i miss something or if it's a bug ?
    Thanks for your help.
    Dominique

    I solved it by commenting the Go_Item(startitm); line in the clear_all_records program unit which is generated by oracle forms.
    as shown below.
    IF :System.Cursor_Item <> startitm THEN
    --Go_Item(startitm);
    Check_Package_Failure;
    END IF;

  • Unable to insert detail record using Master- Detail Form

    Hello All,
    I am new to Apex and we are using Apex 2.2.
    I am trying to create a Master-Detail page using the Wizard. Unable to insert the detail record as the foreign column value is not inserted. How can i assign this value to the child record before inserting? Hope you got my query.
    Pls reply asap
    Thanks
    Biju
    P.S - Can't upgrade to 3.0 yet

    G'day Guys,
    We just had to create a Child Tabular for Master Detail manually ourselves and finally worked out how to set the PARENT_ID field (Foreign Key fields). It was quiet easy after we finally found the little bugger :)
    Under The Reports Attributes for the tabular report, located the PARENT_ID field and edit it (column attributes). Goto the "Tabular From Element" and modify the following values:
    Default Type: Item (Application or page item name)
    default: PXX_FIELD_NAME
    Thats it, so when a new row(s) is added this field defaults to PXX_FIELD_NAME.
    Told you it was easy, but I've just got to glue my hair back in after near tearing it out.
    Reagrds
    Mark

  • How to commit in master detail block

    Hi
    I have a master and a detail block .
    In detail block if i try to insert a record and commit it is working fine .
    But when i try to insert multiple records then I am unable to commit .
    Error given is frm 40508 :Unable to insert record .
    Plz help me
    thanks shubh

    Could you, please check out the complete error message by clicking the help-> display_error menu option ?

  • Insert error in master-detail form

    Probably a stupid question. When I populate the master block of
    a master detail form from an LOV, I am asked to save the form.
    Since the information is loaded from the LOV, there are no
    changes to save. If I answer yes, it gives an Insert error due
    to the primary key violation in the master block table. If I
    answer no, it opens the detail block and gives the correct
    information. The problem is that when I enter information into
    the detail block and try to save it, I get the same error
    message regarding the primary key violation in the master block.
    The form works fine if I do not populate the master block from
    the LOV (or from select statements in triggers). Any suggestions
    will be appreciated.
    LS

    Hi,
    Check for the form or block status.Looks like the status has
    changed.Thats why u r getting the message.If any of the base
    table item has changed then u will get such a message.Try
    working on this an check it out.
    Thanks
    Vinod

  • Serious problem with previous / next record in master-details relations

    I have master-details relations like this (if master is A) :
    A-B
    A-C and C-D
    When I move down with do_key('next_record') all values of all records in all blocks are OK. But when I move up, it doesn't work : all D block values are erased and I don't understand why ?
    Thank you for your help.
    Antoine LEFEBVRE.

    Blocks A and B are in the first canvas and blocks C et D are in the second canvas.
    On next_record action from A the B is updated, C too and D too. But on previous_record action, D is not updates.
    To display the second canvas I use a command button and into the WBP trigger there is :
    go_block(C);
    execute_query;
    to be sure to execute query, but it's null.
    What's your suggest ?
    Thank you,
    Antoine.

Maybe you are looking for

  • 2-seat license not working on Mac running Windows 7

    We have a full retail copy of Adobe Acrobat Pro XI.  We are trying to get it installed on an Intel-Mac (2009 Macbook Pro) running Windows 7 on Bootcamp. After a fresh install, we successfully license the software with the license key.  All works well

  • Photos jittering up and down?

    Hi all, as a new user to elements 13, I did a quick movie as a practise from some photos and videos. It was mainly photos with a few clips and was in total about 6 mins long. I did notice when watching it on TV the photos were slowly moving up and do

  • Battery Monitor problems

    I have a problem with battery monitor. My MacBook shows a charge of 30%, then suddenly goes into emergency sleep mode. If you plug the power in immediately, the system awakes again but the battery monitor then shows something like 7% charge. I have d

  • Output Preview should be more informative

    I love the Output Preview feature in Acrobat. I wish Illustrator had the same thing. However, I feel that there should be some improvement to it. For instance, for printers, it would be very handy to also include line screen, angle, and possibly dot

  • What types of video files can the iTouch play?

    I would like to know which kind of video files it can play, can someone list them? like for example can it play video files (.avi) which is the most common? thanks