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

Similar Messages

  • 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

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

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

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

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

  • Master-detail blocks

    I developped a form with 2 blocks
    that are linked with a master detail relation
    The second block contains the details record of the first one
    Example of tables : dept - emp
    Is it possible to add a record in the dept table that will show all the records from the emp table when you click on it.
    Thank you for your help
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Emmanuelle OTT ([email protected]):
    Hi!
    When you create a detail block using wizard and you get a page in which you have create relationship button which will help you in your desired relation.
    if you create them manually then got to master block and under that create relation in which you you can choose the detail block and the type of relation and the condition and for any further query you can refer to help in the same page by pressing F1.
    regards
    Vidya Verma
    I developped a form with 2 blocks
    that are linked with a master detail relation
    The second block contains the details record of the first one
    Example of tables : dept - emp
    Is it possible to add a record in the dept table that will show all the records from the emp table when you click on it.
    Thank you for your help<HR></BLOCKQUOTE>
    null

  • Problems writing a master-detail relationship (one-to-many)

    I created two classes, Company(has foreign key of companygrp - detail) and CompanyGrp (master). I want the user that I created a company based on a value from CompanyGrp. In other words, I want to create a company record with an existing foreign key of CompanyGrp. I thought I could do the following but it doesn't work:
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = builder.get("name").equal("CORRESPONDENT");
    CompanyGrp group = (CompanyGrp) data.getSession().readObject(CompanyGrp.class, expression);
    ShwsCompany company = new ShwsCompany();
    company.setId(new Double(1));
    company.setName("test");
    company.setShwsCompanyGrp(group);
    data.createCompany(company);
    return mapping.findForward( "success");

    Simon, thanks for answering! I have a foreign key if that's what you are referring. Regarding to bi-directional, I'm not sure if there is a special setup that I need to do in toplink. Currently, I just created the table (along with the constraints) and created the objects.
    Thanks,
    Marcelo

  • Problem in Master-Detail blocks

    Master table : M_sysid, item_code, qty
    Detail table : D_sysid, M_sysid, bno, qty
    Requirement :
    The sum(qty) in detail should always match with master's qty, if the item is a batch item. Post should not be used in the form. The system should not throw 'Changes made...want to save ?' system message.
    Currently we are using recordgroups for qty validation and ON-INSERT trigger is also used in the block-level. Because of this trigger, the document is saved even if any error occurs at the time of saving. So we want to remove ON-INSERT trigger as well as recordgroups.
    Kindly provide an optimal solution.
    Thanks in advance.
    Cheers,
    Uma

    hi
    in key enter_query trigger
    and content canvaz.
    but what is the relation between my question and your answer?
    i can't understand.
    thanks.
    shoja

  • Data not getting in table in master detail block form

    Hi
    I am using oracle forms 10g
    I have three block namely control_block, Header_block and detail_block and three button in three block. Find button in control_block,Detail button in Header_block and save button in Detail_block.
    Now i will enter PO_number in the Control block and enter find button and the po details is fetched and it will show the po details in the Header_block and in the header_block i have one field named as Expeditor and here the user will assing Expeditor to that po_number and Click the Save button in the Detail_Block.
    this is my code
    DECLARE
    ln_count NUMBER;
    CURSOR c_expeditor
    IS
    SELECT po_number
    FROM xxogec_poexp_expeditor_stg
    WHERE po_number = :header_block.po_number;
    BEGIN
         IF :DETAIL_BLOCK.po_number IS NULL
    THEN
    FOR c_exp_rec IN c_expeditor
    LOOP
    IF c_expeditor%NOTFOUND
    THEN
    INSERT INTO xxogec_poexp_expeditor_stg
    (po_header_id,
    po_number, creation_date,
    po_expeditor_name
    VALUES (:header_block.po_header_id,
    :header_block.po_number, SYSDATE,
    :header_block.expeditor
    ELSE
    UPDATE xxogec_poexp_expeditor_stg
    SET po_expeditor_name = :header_block.expeditor
    WHERE po_number = :header_block.po_number;
    END IF;
    END LOOP;
    STANDARD.COMMIT;
    End if;
    End;
    Now when i press save button the data is not getting inserted.
    Can any please correct me where my code went wrong.
    Thanks & regards
    Srikkanth.M

    FOR c_exp_rec IN c_expeditor
    LOOP
      IF c_expeditor%NOTFOUND
      THENYou'll never get to the IF statemement, because there is nothing to loop if there is nothing to be found.

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

  • How do I know which block has been changed in Master/Detail

    Hi,
    I have master detail blocks. How do I know which block has been changed?
    I used :SYSTEM.FORM_STATUS. It only gave me "Changed" or "Query". but didn't tell me which block has been changed in MASTER or DETAIL.

    I believe if :system.form_status != 'QUERY' you'll need to loop through through the blocks checking :system.block_status to see who changed. Of course you'd have to go_block() before checking the status.

  • Problems with block master - detail in forms 10g

    I have a master-detail block, when the record is empty it shows nothing of the teacher, but the record there, thought it was the relationship, but the clear and ran as if it and the error still persists. I need to show me the teacher, although in detail there is no record.
    If anyone can help me they are grateful. Do not know if there are any restrictions in 10g, and I did a master detail with the same tables in 6i the error does not introduce myself.
    Thank you.
    Note: Sorry for the English, I am using a translator.

    I have a master-detail block, when the record is empty it shows nothing of the teacher, but the record there, Can you please give more explanation what you exactly want because em still confuse.
    thought it was the relationship, but the clear and ran as if it and the error still persists. I need to show me the teacher, although in detail there is no record.Also this one. It is better to give any example.
    -Ammad

Maybe you are looking for