Master/Details Form -- Relation Property

Is it possible to set the relation join condition property for a master/detail form programmatically. If so, what is the syntax?
Thanks,
Paul Howard
[email protected]

Use this built in
SET_RELATION_PROPERTY
(relation_name VARCHAR2,
property NUMBER,
value NUMBER);
for more detail check from the help topics. Thanks for the info but the property I want to set isn't a listed property for that built-in. I need to change the actual join statement in the relation object. This is what I'm attempting to accomplish.
I have a master-detail form with the master block containing 1 field (mfg_date)/ detail block containing order information(multiple records). This form allows me to step thru my orders by mfg_date. I need to be able to also step thru these orders by due_date if the operator chooses with a radio button. If I change the query_data_name and the the actual join statement in the relation object from the object navigator and compile and run it works fine. I can change the query_data_name programmatically but I can't find any info on changing the join statement programatically. Or is there another way to change the master block within the same form some other way?
Thanks for any pointers!
Paul Howard
[email protected]

Similar Messages

  • Master-detail form (my detail is in a new canevas-- new window)

    Hello,
    I have a Master-detail form, in my detail when i select a row i want to show an other canevas that becomes a detail for this selected row. i constructed the relationship between my first detail block and my new canevas that contains the detail for the selected row. When I select a row Oracle didn't show me the deatil for this row in the other canevas, i wondered me why? because I thought the relationship between them should atomatically drive the data for the other canevas. If i 'm wong, does someone could tell me what to do to call my canevas detail.
    Master--->details(selected row become master)--->new canevas(contains details)
    the relationship is done between my first detail block and my new details block.
    Charly

    Hi,
    POST-QUERY is definitly the wrong trigger to do what you want to achieve.
    1. The usage of GO_BLOCK in POST-QUERY is not allowed and it will not work.
    2. The detail must be synchronized when navigating in the master-record, not when populating the block
    So the right trigger to do what you want to is the ON-POPULATE-DETAILS-Trigger.
    Problem on this: It will only work if you have a relation on the master-block to the detail block.
    But that's also possible even if you do not have a "direct" relation between the master and the detail block.
    Just create a relation between the blocks based on some dummy-item and then go to the item in the detail-block and set its property "Copy value from" to NULL.
    Now you can add your logic in the ON-POPULATE-DETAILS-Trigger.
    Still one problem left: Where is the window you're going to show placed? If it's on to of the window where the items from the master-block are displayed, then immediately after querying the records in the detail-block the navigation back to the master-block will cause the other window to be shown again (and therefore your detail-window to be hidden again).
    hope this helps

  • Unable to View records in a master-detail form

    In a master-detail form, I am not able to view records of the master/detail table
    by accepting the values of the PK of the header table items.
    Please tell me the exact steps, so that I can view the detail table records based on the header table PK items.
    Thanks.

    Yes I wrote the LOV code in a different procedure. Now, the view is showing correctly. But I am now trying to update the viewed records.
    The steps I am following in View Option is as below:
    go_block('header');
    clear_block(no_validate);
    execute_query;
    proc_lov;
    go_block('item');
    execute_query;
    I am unable to commit the changes made in the blocks
    The reason it is showing is : UNABLE TO update.....I saw the display_error.
    The system is trying to update the PK part also..Why....Though PK party is clearly defined in the table as well as property palette. Pl. explain how to go about it. Uregent help is required once again.

  • 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

  • Creating a new row in a master detail VO relation and its consequences.

    Hi,
    I'm currently facing a lot of problems which make me doubt if my perception about the whole ADF entity-view object mechanism is right.
    I have a page which displays data from a master detail VO relation (master offer - detail officeinfo). I also have a small dialog LOV window which makes it possible for me to select an office to match up with the current offer... Both the office LOV and the officeInfo detail use the same Office entity object.
    This worked perfectly fine until I wanted to add create NEW offers. I created my own insert method which basically performs a createRow on the master VO and inserts the newly created row in this VO. On a sidenote, I also fill out some default data read from a property file, which is why I decided to implement my own insert method in the first place.
    Initially, the problem was that the inputText fields of the detail VO (OfficeInfo) were not displayed at all. I imagined that I also had to perform the create and insert methods on the detail VO and indeed, from that point on all inputText fields were displayed and my page was ready for input.
    Yet today, I notice that in my Office LOV which is based on the same entity as the one my detail OfficeInfo VO uses, this newly created row is ALSO visible. To me this is quite unwanted and surprising behavior. I did not expect the row already to be visible in the LOV, since basically it's just an empty row ready for input...
    Am I perceiving things wrong? Or anyone has a nice solution to fix this?
    Thanks,
    Douglas

    Hi Douglas,
    It is happening because you have created an updateable office LOV which is based on same entity object used to save your newly created records.
    Use readonly LOV based on plsql query in your page and you can keep rest of the thing as it is.
    I think it will solve your problem.
    Cheers,
    Suyog

  • Many to many master detail form

    Hi All,
    APEX 3.1.2 on SuSE 10 Oracle 10.2.0.3 64 bit
    I am new to APEX, but used OAS several years ago. Back then I hardcoded all htp.print commands. We are building an intra-team application to track system relationships. For example,
    web interface 3 --> application server 2 --> database 6
    Our tables are similar to the following
    SYSTEMS
    system_id (unique sequence)
    system_type_id (database, app server, apache, etc.)
    SYSTEM_TO_SYSTEM
    publishing_system_id - number
    consuming_system_id - number
    We would like to have a master detail form where we would query database 6 for example, and then see all related systems one level below it (application server 2 in the example above). I have been able to query the related systems and show them in a drop down pick list on the detail form, but I cannot edit them.
    The wizard asked for the primary key of the detail table, which in this case is not a sequence generated value, but a pick from a systems table lookup on system_id/system_name.
    If the master form would automagically lass the system_id to the publishing_system_id on the detail form, and allow me to update that with a picked system_id tied to consuming_system_id, that would be perfect.
    I can write the htp calls I mentioned earlier, but I am sure I am missing something.
    Does anyone have any best practices for this?
    Thanks!
    Steve

    Hi Steve,
    Here is an example which might help you:
    http://apex.oracle.com/pls/otn/f?p=43368:35
    Here, I have used two tables e.g. test1 and test2. Test1 has an id column which is just a sequence column and the name column in this table has a unique key.
    Table test2 has id column as primary key and name1 column is linked with Test1 table on the Form. Name2 column is not required to be linked with Test1 table.
    If this is what you are after, then I can give your more detail for it.
    Hope it helps.
    Zahid

  • Is this a bug? master rowid value lost when saving on a master/detail form

    master/detail forms seem to lose the rowid after saving, if the unique identifier is set to ROWID
    to reproduce the problem:
    1) create a master detail form on DEPT/EMP
    -- choose 'Managed by Database (ROWID)' on the 'Define Primary Key' page.
    -- do not include master row navigation (but i don't think this matters)
    -- choose 'Edit detail as tabular form on same page' on the 'Choose Layout' page
    -- include the master report
    2) on the master/detail page, change the conditional branch that returns to the master report page
    -- the normal condition for this branch is request in SAVE,DELETE,CREATE
    -- change it to request in DELETE,CREATE
    3) run the form and save a change
    -- saves fine, session shows the ROWID value is still set
    4) save a second change
    -- change does not save, form reverts to Create mode
    this problem does not occur when using the primary key columns instead of rowid
    see http://apex.oracle.com/pls/apex/f?p=60813:7 for the ROWID version
    see http://apex.oracle.com/pls/apex/f?p=60813:11 for the PK column version

    Hi Saverio,
    Bug *13563808* has been logged to track the reported issue, and a fix will be made available in a future release. Just to clarify, this issue is only arising when the APEX-generated Master-Detail is modified post-generation, so for users who have not modified their Master-Details using ROWID to manage their DML processes, they should not experience this issue.
    In relation to my workaround, my suggestion works in my test environment, which I verified before posting the initial suggestion. Please note that the 'Reset Page' process is, by default, conditional on the "Delete" button being pressed. If you have made further modifications to your Master-Detail page, then this might explain why you're seeing different behaviour to me. You might using the "Debug" option on the Developer Toolbar useful. Viewing the debug information should help you to decipher what's going on/wrong on your page. If you still can't resolve the issue, then the safest option might be to revert the page back to it's original state, meaning the user navigates back to the Report page upon submitting changes to the Master-Detail Form page.
    Regards,
    Hilary

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

  • Master-Detail Form in Form6i Developer

    First of All Hi to all Respected Gurus.
    I am stuck in a very basic element and that is Primary-Key/Foreign-Key relation. I am trying to create a Master-Detail Form based on following structure. Records in Master Table and Child Table are saving (inserting) but Primary Key of Master Table is not saving (inserting) as "Foreign Key" in Detail Table.
    Here is Table Structure(s)
    Master Table Name : MGTC_EDM
    CREATE TABLE MGTC_EDM
    EDM_ID NUMBER, -- PRIMARY KEY
    BILLING_DATE DATE,
    CONSTRAINT PK_MGTCEDM_EDMID PRIMARY KEY (EDM_ID)
    CHILD TABLE : MGTC_EDD
    CREATE TABLE MGTC_EDD
    EDD_ID NUMBER; -- PRIMARY KEY
    EDM_ID NUMBER; -- FOREIGN KEY RELATION WITH MGTC_EDM
    MEM_ID NUMBER;
    AMOUNT NUMBER;
    CONSTRAINT PK_MGTCEDD_EDDID PRIMARY KEY (EDD_ID),
    CONSTRAINT FK_MGTCEDD_EDMID FOREIGN KEY (EDM_ID)
    REFERENCES MGTC_EDM (EDM_ID)
    TRIGGER OF "BEFORE_INSERT" IS APPLIED ON BOTH TABLES TO AUTO-POPULATE INCREMENTAL ID
    IN FORM6I, I'VE APPLIED A 'KEY_NEXT_ITEM' TRIGGER ON BILLING_DATE FIELD OF MASTER TABLE TO COMMIT THE RECORD AND TO MOVE THE CURSOR TOWARDS DETAIL BLOCK
    AND THERE ARE NO MORE TRIGGERS IN THE FORM.
    AS CURSOR MOVES TOWARDS DETAIL BLOCK, RECORD IN MASTER TABLE SAVES (COMMITTED) ON AUTO AND WHEN I PRESS "SAVE" BUTTON TO SAVE THE RECORD IN CHILD FORM DETAIL TABLE ALSO COMMITTED
    BUT WHEN I PRESS F8 TO EXECUTE THE QUERY ONLY MASTER RECORD SHOWS AND NO RECORD SHOWS IN THE DETAIL TABLE. WHEN I CHECKED IN DETAIL TABLE IN TOAD, IT FOUND THAT PRIMARY KEY OF MASTER TABLE (EDM_ID) NOT SAVED IN DETAIL TABLE.
    PLEASE HELP.

    Dear Mr. O.Developer, Many thanks for your reply.
    Yes, I've created relationship. Relationship exist in Master_Block and below is the detail
    Relationship Name = MGTC_EDM_MGT_EDD
    Relation Type = Join
    Detail Data Block = MGTC_EDD
    Join Condition = MGTC_EDD.EDM_ID = MGTC_EDM.EDM_ID
    Delete Record Behavior = Non Isolated
    Prevent Masterless Operations = No
    Deferred = No
    Automatic Query = No

  • How order by  use in master detail form

    hi master
    sir i have master detail form but show data with out order by
    my need is form show data in order on date
    please give me idea how order by use in master detail form
    thank
    aamir

    Set "Order by Clause" Property at block level
    Cheers
    Gouri Sankar

  • File Browse Item in Master-Detail Form

    Hi,
    This is what I need to do.
    I have a master table called Regulations. As part of the Regulation Creation process, users need to upload supporting files. The number of files is not fixed, so I have a detail table for the uploaded files. I was planning to create a Master Detail form and have a File Browse item in the detail region? Is there a way I can put a File Browse item in the detail region of the Master Detail form?
    Any other implementation suggestions are welcome.
    Thanks,
    Ramesh

    See
    http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/
    It has some interesting implementation ideas relating to your question.
    Also see
    Upload Multiple Files
    Re: insert multiple files from a single form

  • Default reference ID in Master Detail form

    Hi,
    I created a master detail form.
    When inserting a new record in the detail block, I want that value from the PK item from the master block appears
    in the FK item of my detail block. This problem was showed long time back in March, 2002. The answer at that time is
    this issued would be fixed in 3.0.8. Now, I still have same problem and wonder if anyone has any idea?
    Thanks,
    Amanda

    I am using 3.0.9 and its working fine for me. Which version r u in? Are you gettin 'Join Conditions' page where you can define PK/FK relation and that will take care of what you want. There is a javascript on faq for portal which you can use if your version is not supporting this one.
    Hope this will help
    thanks
    Bakulesh

  • Bind variable in Master Detail form

    Is there any way to go to a specific master record (bind variable) and it's associated detail information in a master detail form using a link from another report?
    Louis

    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

  • More than one Detail table in the Master Detail forms!

    Hi,
    I need to have more than one Detail table in Master Detail Forms.
    I want to see the details of the rows of the first Detail table in the Second Detail table. Please guide me to do this.
    Sincerely yours,
    Mozhdeh

    You can do one of two things
    1) Depends on the nature of your data model. I was able to manage many to many
    relationships using views and instead of triggers. This solution is somewhat complex but can work in certain situations.
    2)Works for situations where master record exists. create a page with mulitple portlets syncronized on some related key.
    create the following package to use on the md forms to place on the one page to be rendered.
    -- this package will facilitate the storage and retrieval of keys used by the related forms.
    create or replace package session_var
    IS
    session_parms portal30.wwsto_api_session;
    g_domain varchar2(2000) := portal30.wwctx_api.get_user;
    function get_id (id in varchar2) return number;
    PROCEDURE SET_ID
    (ID in VARCHAR2
    ,p_val in VARCHAR2
    ,P_URL in VARCHAR2
    END SESSION_VAR;
    create or replace package body session_var
    IS
    --pkg body
    function get_id(id in varchar2) return number is
    l_store_session portal30.wwsto_api_session;
    l_id number;
    begin
    l_store_session := portal30.wwsto_api_session.load_session(
    p_domain => session_var.g_domain,
    p_sub_domain => 'your domain');
    l_id := l_store_session.get_attribute_as_varchar2( p_name => id);
    return l_id;
    end get_id;
    PROCEDURE SET_ID
    (ID in VARCHAR2
    ,p_val in VARCHAR2
    ,P_URL in VARCHAR2
    IS
    l_store_session portal30.wwsto_api_session;
    begin
    l_store_session := portal30.wwsto_api_session.load_session(
    p_domain => session_var.g_domain,
    p_sub_domain => 'your domain');
    l_store_session.set_attribute(
    p_name => id,
    p_value => p_val );
    l_store_session.save_session;
    * Redirect to the page using p_url;
    portal30.wwv_redirect.url(P_URL);
    end set_id;
    END SESSION_VAR;
    --the form master detail form, section  before display page enter the following code and publish as portlet.
    declare
    l_fs varchar2(4000);
    l_s varchar2(4000);
    v_con_id number;
    begin
    v_con_id :=rfq.session_var.get_id('CON_ID'); -- primary key and key used to relate details
    p_session.set_shadow_value( p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_CON_ID', -- attribute on form related to primary key
    p_value => '= '|| v_con_id,
    p_language => portal30.wwctx_api.get_nls_language ,
                   p_index => 1
    l_fs := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK', p_attribute_name => '_FORM_STATE');
    l_s := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK', p_attribute_name => '_STATUS');
    if l_fs = 'SAVE' and l_s is null then
    WWV_MASTER_GENSYS_1(p_block_name => p_block_name,
    p_object_name => p_object_name,
    p_instance => p_instance,
    p_event_type => p_event_type,
    p_user_args => p_user_args,
    p_session => p_session);
    p_session.save_session;
    end if;
    if l_fs = 'QUERY_AND_SAVE' and l_s is null then
    WWV_MASTER_GENSYS_1(p_block_name => p_block_name,
    p_object_name => p_object_name,
    p_instance => p_instance,
    p_event_type => p_event_type,
    p_user_args => p_user_args,
    p_session => p_session);
    p_session.save_session;
    end if;
    exception
    when others then
    PORTAL30.wwerr_api_error.add(PORTAL30.wwerr_api_error.DOMAIN_WWV,'app','generic','onLink', p1 => sqlerrm);
    raise;
    end;
    --then create other md forms and publish as portlets in a similar manner.
    -- create a form (form_session_vars) to call procedure session_vars and place the following code in the
    addiontional pl/sql tab
    WWV_GENSYS_1(
    p_block_name => p_block_name ,
    p_object_name => p_object_name,
    p_instance => p_instance ,
    p_event_type => p_event_type ,
    p_user_args => p_user_args ,
    p_session => p_session);
    --then create a page and place the md forms created above as portlets on the page.
    --create a link and target the form_session_vars and in the link target inputs
    enter the values for your user parameters
    id= CON_ID --"your primary key name"
    p_url= url/page/"your_page"
    --finally create a report (QBE or standard).
    in the column formation section use the link created earlier to direct the user to the target page.
    How it works.
    When the link is selected the form_session_Var is called and automatically runs setting the primary key values
    in the user session store. The step is required or the resulting page will not render properly. Then the user is redirected to the page where the portlets are rendered. The portlets start rendering, the before display page calls the session vars package to retrieve the key and put the form into query_update mode returning the data.
    The portlets finish in query_and_save mode with details in update mode, the allowable insert, delete and none actions will be available for the details.
    benefits: The session_Var package code is resuable as well as the form form_session_Var and the link. passing the key name and values are done at the report level and detailed in the report links. the md forms will need to reference their related keys.

  • Error creating Master/Detail Form

    Hi,
    I tried to create a master detail form. I went through all the steps fine, only when i click the button to create the form, i received the following errors:
    ORA-20001: Unable to create master detail page. ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Unable to create Master Detail pages.
    Could someone please tell me what's wrong?
    Thanks,
    Patrick.

    We are getting this message in several areas in the development environmnet. It's happening in the developer login screen, when creating new tabs, and when tryig to create master detail reports. Here is our error from the Apache Log:
    [Mon Mar  2 11:41:31 2009] [error] [client 10.64.8.231] [ecid: 1236012090:148.94.143.136:24226:0:1621,0] mod_plsql: /pls/apex_qmnt/wwv_flow.accept HTTP-404 ORA-06502: PL/SQL: numeric or value error\nORA-06512: at line 31\n
    I think this is different from the issue above as that is due to too many items in a shuttle list. Ours seems to be related to our new APEX insstallation. Any help is appreciated here.

Maybe you are looking for