Auto Query in Master Detail Form using dynamic page doesn't work

I created a Master-Detail form, and implement AutoQuery using a dynamic page
with the following code :
<HTML>
<BODY>
<ORACLE>DECLARE
nre_ VARCHAR2(100);
BEGIN
nre_ := emp_nre;
if nre_ is not null then
net_portal.Popula_Agregados(nre_);
net_portal.Popula_Docs_Agregados (nre_);
htp.p('<iframe id=myFrame name="myFrame" frameborder=0 width="250%"
height="300"
src="/pls/portal/PORTAL.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=
3
388118140&p_arg_names=_show_header&p_arg_values=NO&p_arg_names=_cad_nre_cond&p_a
rg_values=%3D&p_arg_names=cad_nre&p_arg_values='||nre_||'">
</iframe>');
end if;
EXCEPTION
WHEN OTHERS THEN
htp.p(SQLERRM);
END;
</ORACLE>
</BODY>
</HTML>
It works fine when we access the first time to the page, but if i press the
save button after inserting or updating a detail record, the header record is
lost. How can i avoid this situation ?

I changed query:
select
Replace(
'<img src="#IMAGE_PREFIX#ed-item.gif" border="0" alt="EditMap" usemap="#editmap***id***"></img>
<map name="editmap***id***">
<area shape="rect" coords="0,0,16,16" href="http://apex.oracle.com/pls/otn/f?p=&APP_ID.:'
|| decode ( type, 'FOLDER', '33', '22' )
|| ':&APP_SESSION.::&DEBUG.::P'
|| decode ( type, 'FOLDER', '33', '22' )
|| '_ID,P'
|| decode ( type, 'FOLDER', '33', '22' )
|| '_CALLING_PAGE:' || id || ',&APP_PAGE_ID." ></area></map>' ,
'***id***', id
) Edit,
id,
type,
name,
decode ( type, 'FOLDER', 33, 22 ) target
from tThe idea is - each img uses its own map.
It works now.
Check:
http://apex.oracle.com/pls/otn/f?p=20980:13
Lev
Edited by: le on Nov 3, 2010 11:11 AM

Similar Messages

  • How to create a master detail form using single table

    Hi,
    how to create a master detail form using single table.
    Regards,
    M. Satish

    Hi
    how to create a master detail form using single table.Make the Master ur pks the details the rest of ur data base field in the detail it's a mater of organizing fields on a form M-Detail...
    Now What ?
    Regards,
    Amatu Allah

  • How to create a master detail form on same page in apex 4.2.1

    Hi All,
    i need to design a master detail form on same page i am not finding an option in wizard from where i can do that.
    will appreciate your suggestions.
    Thanks

    Hi James,
    I think that Mike is suggesting that you create a SQL View over the table and join together the individual primary key values into a single, unique, pseudo primary key. You can still include the individual columns in the SQL but you can then use this new column as the primary key on a form. However, you would also need to create INSTEAD OF triggers to handle inserts/updates/deletes as SQL will not allow you to update tables through a view. (See: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/create_trigger.htm#i2064426] for the Oracle details on this or Re: How to update view resp. table for an example within Apex).
    Ideally, though, you should only really need one key column - is there any need for four?
    Andy

  • How to create a MD form using dynamic page ?

    Rahul and Sharmila,
    You have answered several of my queries earlier and I am thankful for them.
    I have been trying to creating a MD form using dynamic page and I haven't fiqured it out. I need help. You both advised me on creating a simple form using dynamic page. The complexity changes drastically when I have to create a MD form. Has no body ever tried to create a MD form with dynamic page?
    I haven't heard from you anything either. I am stuck with this and I need help urgently. Would you kindly tell me if this is possible and how ? Otherwise, I will stop crying for help on this.
    Thanks for your kind attention.
    Mainak

    Hi,
    I have replied to this in the morning.
    Re: Oracle portal and JSR 168 compliance
    Hope it helps.
    Thanks,
    Sharmila

  • Master-Detail Form using Oracle XE...

    Hi ,
    Which type of page (blank , form , ....) should i select in order to create a master - detail form (dept - emp tables on SCOTT schema) in one and just one page (no tabs)...????
    And also . . . is it possible the above form to be used for both inserts , updates and deletes...????
    Many thanks ,
    Simon

    Hi Simon,
    Use form then Master Detail Form.
    You can insert, delete, and update rows.
    http://htmldb.oracle.com/pls/otn/f?p=26372
    for example of Master - Details - Details solution (not a form).
    Konstantin

  • Insert new row to master - detail form using bindingsource

    Hi all,
    I have a form to analyse price of product, the form include master (textbox:slip ID,datetimepicker : date) and detail(datagridview:slipID,productID,price..)
    When I insert new row as below code, all inserted to DB but not show on form, I must close and reopen the form the new row will show, how i must to do to fix it 
    please help, thanks
    Select data when form load 
    ds = New DataSet
    damaster = New SqlDataAdapter("select soPTG,ngaybd,ngaykt,khoa = case when sttesign =0 then 'True' else 'False' end from tbl_PTGMaster", conn)
    damaster.Fill(ds, "tbl_ptgMaster")
    dadet = New SqlDataAdapter("select [SoPTG],[Mahang],[gianhap],[thuesuat],[laigop],[giacu],[giamoi] from tbl_PTGDetail", conn)
    dadet.Fill(ds, "tbl_ptgdetail")
    ds.Relations.Add("PTG_rel", ds.Tables("tbl_ptgmaster").Columns("SoPTG"), ds.Tables("tbl_ptgdetail").Columns("SoPTG")).ChildKeyConstraint.UpdateRule = Rule.Cascade
    BindingMaster.DataSource = ds
    BindingMaster.DataMember = "tbl_ptgmaster"
    BindingDetail.DataSource = BindingMaster
    BindingDetail.DataMember = "PTG_rel"
    gridchitiet.DataMember = "tbl_ptgdetail"
    txtptgnumb.DataBindings.Add("text", BindingMaster, "soPTG")
    dtstart.DataBindings.Add("Text", BindingMaster, "ngaybd")
    dtend.DataBindings.Add("Text", BindingMaster, "ngaykt")
    cmdlock.DataBinding.Add("Enabled", BindingMaster, "khoa", True, DataSourceUpdateMode.OnPropertyChanged)
    setStatus()
    SetHeader()
    Dim cmdinsert As New SqlCommand("insert into tbl_PTGMaster(SoPTG,ngaybd,ngaykt) values(@SoPTG,@ngaybd,@ngaykt)", conn)
    cmdinsert.Parameters.Add("@soPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
    cmdinsert.Parameters.Add("@ngaybd", SqlDbType.DateTime).Value = dtstart.Value
    cmdinsert.Parameters.Add("@ngaykt", SqlDbType.DateTime).Value = dtend.Value
    damaster.InsertCommand = cmdinsert
    damaster.FillSchema(ds, SchemaType.Source)
    cmdinsert = New SqlCommand("insert into tbl_PTGDetail(SoPTG,mahang,gianhap) values(@SoPTG,@mahang,@gianhap)", conn)
    cmdinsert.Parameters.Add("@SoPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
    cmdinsert.Parameters("@SoPTG").Direction = ParameterDirection.InputOutput
    cmdinsert.Parameters.Add("@mahang", SqlDbType.Char, 10, "mahang")
    cmdinsert.Parameters.Add("@gianhap", SqlDbType.Decimal, 8, "gianhap")
    dadet.InsertCommand = cmdinsert
    dadet.FillSchema(ds, SchemaType.Source)
    gridchitiet.FinishEditing()
    BindingMaster.EndEdit()
    damaster.Update(ds, "tbl_PTGMaster")
    ds.Tables("tbl_PTGMaster").AcceptChanges()
    BindingDetail.EndEdit()
    dadet.Update(ds, "tbl_PTGDetail")
    ds.Tables("tbl_PTGDetail").AcceptChanges()
    BindingMaster.ResetBindings(False)
    BindingDetail.ResetBindings(False)

    Hello,
    The base idea here is if the record is added successfully you would then get the new primary key then manually add the record to the underlying data source. Does not matter if we are talking a single table or a master-detail setup.
    The following shows the basics
    https://code.msdn.microsoft.com/Adding-new-records-into-bff5eaaf 
    All of the above is done without using a DataSet yet the same thing needs to happen with a DataSet, simply focus on the one table.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Problem with Master -Details forms in seperate pages

    Hi ,
    Below is the scenario:
    I have Institution and a department tables where there is a foreign key relation between the tables. So now i have two entity objects for the 2 tables and 2 view objects(DepartmentView,InstitutionView) from the entity objects.
    I also have a view link between them.I made a master-detail relation between them in the datamodel using the view link.So my appmodule now has getters for the department view,institution view and viewlink.
    I now have a jsp page "createInstitution.jsp" which contains a form for the institution , i have a "next" button on the same jsp which calls a method in my appmodule class .This methods just inserts the record into the Institution view. In this method i am able to see what the user entered in the form by getting the viewrow record like the below code :
    InstitutionViewRowImpl newInstitutionRow=(InstitutionViewRowImpl) getInstitutionView().first();
    The next button navigates to the next page "listDepartments.jsp" which contains the list of departments that are added. This page has a button "Add Department" which takes to to the "addDepartment.jsp" page which shows a form for adding a department. This page also has a button which calls a method in app module class. The method just inserts the record into the view(DepartmentView)
    Here when i say
    DepartmentViewRowImpl newDepartmentRow=(DepartmentViewRowImpl ) getDepartmentView().first();
    the newDepartmentRow is null.
    Also on the addDepartment.jsp form , i had used a output field to see what the parent id was and interestingly the parent id is 75 which is first institution in the database. It should have been "-10" , a temporary id assigned.
    Can someone please tell me what is the problem with my approach?

    I don't understand why you are using a method on your button to insert the record into the table - An Oracle ADF Form will do the insert for you by default without any coding.
    See the create pages in these tutorials:
    http://www.oracle.com/technology/products/jdev/11/cuecards/adf_set_21/ccset21_ALL.html
    http://www.oracle.com/technology/obe/obe11jdev/11/dev_ui/developuserinterface.html#t2s5
    The method that you are calling just returns the first record in the rowset - I don't see how it has anything to do with actually inserting the data into the table.

  • Master Detail Form - Problem using built in wizard

    Hi There
    We are working on Application express 2.2.
    We are facing problems for a master detail form using Wizard. The
    details are as follows : >>
    1) Master table : TS_ENTRY_TXN
    trans_id P.K.
    2) Detail table : TS_ENTRY_TXN_DETAIL
    a)trans_id
    b)sub_trans_id Composite P.K.(trans_id,sub_trans_id) & these are
    based on sequences.
    If i try to build a master detail form using the Wizard, the options
    for providing P.K. for master & detail are listed which we used.
    As it is a master detail form, we want to carry trans_id to the detail
    for updations/insertions which doesn't happen.
    The MRU fails with oracle error :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1,
    ORA-01400: cannot insert NULL into
    ("TS_APEX"."TS_ENTRY_TXN_DETAIL"."ENTRY_ID"), insert into
    "TS_APEX"."TS_ENTRY_TXN_DETAIL" ( "ENTRY_ID", "SUB_ENTRY_ID",
    "SMR_ID", "TASK_ID", "SUB_TASK_ID", "TIME_SPENT", "REMARKS") values (
    :b1, :b2, :b3, :b4, :b5, :b6, :b7)
    Is there any other way to build master detail wihout wizard.
    Could you please suggest us better way to complete this task.

    If I'm reading this correctly, then one of the columns in your detail tables' primary key is also the foreign key pointing to your master table? If that's the case, then that's not supported by the wizard. For the wizard generated master-detail form to work properly, you'll have to have a foreign key column in your detail table which is not part of your detail table's primary key.
    Hope this helps,
    Marc

  • Problem in Master Detail form when using ADF table for Detail

    hi,
    jdev version-11.1.2.1.0
    i have create Master detail form using datacontrol drag as ADF Master Form Detail Table.
    Now when i create a new row in Detail table using CreateInsert button a blank new row created on the top of detail table.
    and other row show that data of previous record based on master.
    problem is that i want when i click on createInsert button all row of detail table should be blank and when user fill two or three row then commit.
    Thanks in Advance

    Hi,
    if a detail table has data, then createInsert adds to these. If you want to hide existing rows, create a new View Object instance and set its "Retrieve from the Database" option to "No Rows". The use an af:switcher to change the table shown when the user clicks the createInsert button. There is a bit of coding required to have this use case in ADF, but its mostly declarative. Bottom line is that there is no automated option other than creating new rows in a separate page or dialog if you are bothered by existing rows
    Frank

  • Validating WEBDB2.2 Master-Detail form

    I would like to validate a Master-Detail form using Javascript in WEBDB 2.2. There is the option to validate field/forms in other types of Forms (based on Table/View, based on Query, etc...) but I do not see that option in a Master-Detail Form. Any help would be appreciated.
    Thanks

    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;

  • Field values erases when Add Row button is pressed in Master Detail Form

    Hi,
    I am using APEX 4.0. There is a master-detail form in a page, this has 5 rows in it by default, has a Add row and a Delete button. I face two problems now:
    1. When the values are entered in all the 5 rows, that are in default, and Add Row button is clicked, these values are entered in the DB, but they are erased from the interface. Means when user clicks Add row he don't see the old values he has entered. All new empty rows are only seen. This might confuse the user. How can I resolve this.
    2. The values are saved to the DB only when the Add row button is clicked, so suppose if the user enters some wrong values in the default rows and after he clicks Delete button, all the field values are erased. Is there a way to delete only that particular row? (Please note: the values are not saved to the DB, unless the Add Row button is clicked)
    Please let me know how to resolve these 2 issues.
    Thanks.

    So let me get this straight:
    You enter information into a tabular form and then click the add row and the data is being duplicated from the prior row or being inserted into the table ?
    Thank you,
    Tony Miller
    Webster, TX
    A lady came up to me on the street, pointed at my suede jacket and said "Do you know a cow was murdered to make that jacket?"
    "I didn't know there were any witnesses", I replied " Now I'll have to kill you too"

  • 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

  • Master Detail Forms

    Can somebody please explain to me how to set up a Master Detail form using Apex 3.1.0?
    The help system is not very helpful.
    I have a Master table whose PK is based on a sequence.
    I have a Detail table whose PK is the concatenation of the Master table's PK with a VARCHAR2.
    Here is how the form is supposed to work: I enter data on the master and detail sections, click an Insert button and 1 record should go into the master and 1 or 2 records into the detail.
    But now I am on the pages that ask me to choose the source for the PK's.
    The source for the master is easy -- it's the sequence.
    But how do I enter the source for the detail table primary key columns?
    The first part of the PK comes from the same sequence number that the master table is based on, so I do not want the sequence to increment once to populate the master table and again to populate the detail table.
    The second part of the PK comes from a value that was entered on the form.
    So how do I accomplish this?
    Do I choose "Existing sequence" for the first PK source and "Custom function" for the 2nd?
    Or what?
    Thanks for your help. Please be as specific as possible in your answer.

    I tried creating a master detail form using a view of the current date's attendance(from the MASTER table) as the detail table AND and the table of all date's attendance as the MASTER table. If I want just the current date's attendance from the MASTER table..how do I get those records the show in the detail of the form?

  • Having problem with creating Master Detail form , please help

    I have to work on a project to create a survey system using APEX, as am new on using this tool , am still facing some problems to finish my job..
    i created Master/Detail form using wizard, the master form is working fine but am when i try to add data using the detail form its giving me error :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "A884FA378C851786DDFE3A33709CB23C", item checksum = "5F8B1EE5CD3D46437455F43B37B9A6A0"., update "ABA"."ABA_SURVEY_SUBCATEGORY_MAST" set "ASCM_CATEGORY_ID" = :b1, "ASM_SURVEY_CODE" = :b2, "ASSM_SUBCATEGORY_ID" = :b3, "ASSM_SUBCATEGORY_DESC" = :b4
    i tried to go through the posts from others but i still dunno what is this error !!!& how to solve it..
    my master data table have 2 primary keys.. the details data table have 3 primary key all of them using trigger to fire a sequence to get the next_val!!
    am desperate & need help urgently for this ASAP.

    hello
    here is the solution,i hope this might help u.
    go to the code of your button and change write the following
    go_block('name of your master block');
    execute_query(no_validate);
    and in the object navigator make the first item in the master
    block that it should be displayed in the canvas and it must be a
    navigable item too.not a display item.
    thank you
    Zeeshan Ahmad

  • Master Detail form - Problems

    We are facing problems for a master detail form using Wizard. The details are as follows : >>
    1) Master table : TS_ENTRY_TXN
    trans_id P.K.
    2) Detail table : TS_ENTRY_TXN_DETAIL
    a)trans_id
    b)sub_trans_id Composite P.K.(trans_id,sub_trans_id) & these are based on sequences.
    If i try to build a master detail form using the Wizard, the options for providing P.K. for master & detail are listed which we used.
    As it is a master detail form, we want to carry trans_id to the detail for updations/insertions which doesn't happen.
    The MRU fails with oracle error :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01400: cannot insert NULL into ("TS_APEX"."TS_ENTRY_TXN_DETAIL"."ENTRY_ID"), insert into "TS_APEX"."TS_ENTRY_TXN_DETAIL" ( "ENTRY_ID", "SUB_ENTRY_ID", "SMR_ID", "TASK_ID", "SUB_TASK_ID", "TIME_SPENT", "REMARKS") values ( :b1, :b2, :b3, :b4, :b5, :b6, :b7)
    Is there any other way to build master detail wihout wizard.
    Could you please suggest us better way to complete this task.

    Hi San Mat,
    I would never recommend having a composite PK on any table. Use the sub_trans_id as the PK in its own right and have trans_id as a Foreign Key pointing to the master table.
    However, given your existing table structure, what you need to do is add a Default value for the ENTRY_ID field on the child table that points to the Page Item used for the PK field on the master table (you've said trans_id but do you mean ENTRY_ID??). On the column's Column Attributes page, set Default Type to Item (Application or page item name) and the Default to P1_ENTRY_ID (or whatever the name is of field is on the master table's form that holds the PK)
    When a new row is added to the child table, the ENTRY_ID from the master table is inserted automatically.
    Regards
    Andy

Maybe you are looking for

  • Error while activating the InfoSource.

    Dear Friends: i have the following error when i try to activate an Infosource (0MATERIAL). The error refers to the error log which in SLG1 is as below. According to the error,I did not find any routines in the transfer rules for 0RT_CONFMAT. Please a

  • How can i get in work my Hp scaner with my macbook pro?

    how can i get in use my Hp scaner with my macbook pro?

  • Highlighting field, if it's a repeat/duplicate throughout report

    I want a field to highlight if it's an repeat/duplicate through out the report. I'm using =iif(Fields!PART_ID.Value =previous(Fields!PART_ID.Value), "yellow", "transparent") and currently it only works within a group section of the report. Suggestion

  • Field wont display on some rows

    I have an error where some fields in a crystal report will return blank when run from a specific computer. The report contains a database field which is in a repeating row.  The computer in error will not print any text in this field if the text it s

  • T400 is Stuck on Thinkpad Startup Screen

    Had the laptop for 11 months no issues, I woke up to find the computer stuck on the startup screen. Tried rebooting, took out the battery, tried it pluged in, unpluged and it keeps stopping at the startup screen. Any suggestions? Solved! Go to Soluti