Issues in Processing the Master-Detail Form values

We have a requirement in Oracle Internet Expenses (11.5.10) to fetch the form values from the Expense Allocations Screen.
This page is based on Multiple VOs with Master Detail relationship. The data from the VOs mentioned are displayed in the Hgrid region.
I need to fetch the input values for three fields (from different VOs) and pass them as paramater to the database function to perform the validation.
Here, I am creating the handle for VO objects and using the Row object getting all rows in range (getAllRowsinRange()).
The issue here is always, the Row length() is always fetched as 1 even it has multiple rows.
Any help on this would be highly appreciated.

Using Select Options u will get mulitiple values also u will get values like table.
regards,
kumar.

Similar Messages

  • Primary key updation in the Master details form.

    Hi All,
    I am struggling with Master Detail form in apex 3.12.
    I have two tables.
    SaleMaster ( TRN_ID as PK ) Created from Sequence.
    SaleDetail ( TRN_ID , TRN_TYPE as PK) TRN_ID FK from SaleMaster , TRN Type is user Input in SaleDetail.
    What is best simple way to create the master details form for the above master details tables.
    Thanks.

    I found a way. I dont like it - but it works.
    I made a column link in the detail with the following:
    javascript: doSubmit('NAVIGATE@#ROWNUM#);
    This way I obtain information in the :REQUEST object about which row was clicked.
    In a After submit process on the page I then parse this :REQUEST object like this:
    DECLARE
    v_row NUMBER;
    v_pos NUMBER;
    BEGIN
    v_pos := instr(:REQUEST,'@',-1);
    v_row := substr(:REQUEST, v_pos+1);
    IF APEX_Application.g_f02(v_row) IS NOT NULL THEN
    :P_PRIMARY_KEY_ID:= APEX_Application.g_f02(v_row);
    ELSE
    :P_PRIMARY_KEY_ID:= -1;
    END IF;
    END;
    I know that my "Id" column is named f02 in the form, so this way I can find the id. I then assign this id to a kind of global variable - on the page I redirected to I can now find the Id.
    Talk about ugly code :P

  • Error while creating the master-detail forms

    on creation of a new master-detail form or on edit of a existing master-detail form, i get the following error -
    ******** START ERROR **********
    Thu, 15 Mar 2001 23:02:16 GMT
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "CC_INTRANET.WWV_BIND", line 56
    ORA-06512: at "CC_INTRANET.WWV_UI_LOVF", line 3123
    ORA-06512: at "CC_INTRANET.WWV_UIFORM_BUILD", line 2850
    ORA-06512: at "CC_INTRANET.WWV_UIFORM_BUILD", line 5567
    ORA-06512: at line 8
    DAD name: cc_intranet
    PROCEDURE : CC_INTRANET.wwv_uiform_build.show_header
    URL : http://webdb.us.colorcon.com:7777/pls/cc_intranet/CC_INTRANET.wwv_uiform_build.show_header?p_wizard_mode=MASTER&
    ********** END ERROR ********
    any ideas anyone ... ?
    thanx in advance ...
    null

    more information on above -
    i upgraded webdb 2.2 to portal 3.0.6 and the new master-detail form is been created in the upgraded site.
    pls reply on this.
    thanx a bunch
    null

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

  • To attach a RTF template(Report for printing ) in the master detail form

    I have an application in which I have 3  master detail forms  of which one of the form is a gate pass form . Now this gate pass form has a report region as the detail.
    All that i need help is to print the Gate Pass with few fields as information in the gate pass form , where an image or picture of the visitor is also a filed .
    Now I have created an RTF Template  which is the Gate pass layout with the pic.
    So ultimately I have the application for the gate pass form and the RTF template ready with me .. Fixing this template with the application with a BUTTON called PRINT is the challenge am facing !
    SELECT XVH.GPDATE
           , TO_CHAR(XVH.VISITORTIMEIN, 'HH:MI') VISITORTIMEIN --, (XVH.VISITORTIMEIN )
           , (TO_CHAR(XVH.VISITORTIMEOUT, 'HH:MI'))VISITORTIMEOUT
           , XVH.VISITOR_NAME --, = XVH.PERSON_ID
           , XVH.COMAPANY_NAME
           , XVH.PURPOSE_OF_VISIT
           , (SELECT A.FULL_NAME
                FROM PER_ALL_PEOPLE_F A
               WHERE A.PERSON_ID = XVH.PERSON_ID
                 AND SYSDATE BETWEEN A.EFFECTIVE_START_DATE AND A.EFFECTIVE_END_DATE) To_meet
           , XVH.VISITOR_PHONE
           ,APPS.GETBASE64 (XVH.VISITOR_PHOTO)
      FROM xxcdot.XXBCT_VGPF_HEADER XVH
    WHERE XVH.GP_HEADER_ID =  :P_HEADER_ID
    This is the query for the template ..
    Please help me with this. I am very new to apex and learning it with help of online tut

    Pars I need another Help
    I am working with a master detail form where in the form region i have a Radio group . Lets say the Radio group is
    o Returnable
    o Non Returnable
    o Other
    so when i select Non returnable I want a particular column called
    Line Status to get Disabled .
    I have done that by a dynamic action - using jquery statement (.Disable) .
    Defining the element attributes as Disable .
    Now the problem is that ,, Line status is getting disabled on the selection of Non returnable radio button. but unless and until i dont press the Add row button it does not work ,, else i will have to switch over between the radio buttons to get this action done !!

  • 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

  • How to set the Master Action of a master detail form?

    Hi,
    I have a regular form navigates to a master detail form in
    insert mode. How do I make the MASTER_ACTION show up
    as "Insert" instead of "None"? If I call the Master detail form
    in auto query mode, it will show up as "Update" in the
    MASTER_ACTION. How do I make the MASTER_ACTION show up as
    "Insert" instead of "None"?
    Any ideas are highly appreciated.
    Thanks;
    Kelly.

    Just have a look over these two statements if it solves your problem
    one time where clause
    Set_Block_Property('BLOCK_NAME',ONETIME_WHERE,your form item);
    dynamic where clause
    set_block_property('BLOCK_NAME'default_where, your form itme)
    you can where clause at run time from any procedure or some triggers

  • Master-Detail Form - implementing some thing like Post-Query trigger

    Hi all,
    I am struggling to implement an eqivalent of a post-query trigger in Oracle Forms. Please bear with me as I am trying to explain in detail what the problem is.
    Here is my situation.
    I have three tables EMP, DEPT and LOCATION. I created a Master/Table pages on EMP and DEPT.
    Basic relationships.
    Each LOCATION has one or more DEPTs; Each DEPT is at one and only one LOCATION.
    Each DEPT has one ore more EMPs; Each EMP is assigned to only and only DEPT.
    Not getting too complicated, here are the table layouts:
    LOCATION:
    ID number(10,0) not null,
    NAME varchar2(20) not null
    DEPT
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    LOC_ID number (10,0) not null foreign key from LOCATION
    EMP
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    DEPT_ID number (10,0) not null foreign key from DEPT
    Assume I have all the constraints, BIU triggers, sequences defined properly.
    I am using the APEX page wizard to create a Master/Detail Form on DEPT and EMP. The first page is the Master Report on DEPT. I want to display the Location Name on this page also. Because the Master Report allows
    you to change the query, I was able to add the Location Name as part of the
    query. This was very simple.
    Select a.name "Department_Name",
    b.name "Location"
    from dept a, location b
    where a.loc_id = b.id
    Moving on, In the Master Detail Form, I would like to get the Location Name as part of the first Region (Dept Region).
    In this region, I would like to include the Location Name also. So my first region on the Master Detail form includes:
    Dept Id: ________
    Dept Name: _______
    Location Name: __________
    As Region are automatically populated using using a Fetch Row from EMP table (Automated Row Fetch) on an After Header process point, I don't have a way of including the Location as part of query. So I created a Region level Item called Location Name, made it Display only.
    In the old SQL*Forms, or Oracle Forms days, I used to use a Post-Query trigger, or Post-Change trigger to fire on the Loc_Id column to populate the Location Name. Simple fetch like:
    Select name
    into :P80_location_name
    from location
    where loc_id = :P80_loc_id
    However, I am struggling to implement some thing simple like this in APEX. Tried creating a processes, computatations etc, but nothing is working.
    I have seen some previous responses to fetching values from a foreign table
    using a button or AJAX script, but this should be very basic. What am I
    missing here?
    Appreciate any insights.
    Thanks.
    John

    Hi John,
    I'm not too familiar with the post-query triggers in Oracle Forms, but the use of a List of Values (LOV) on your LOCATION table might do the trick for you. If you create a dynamic LOV based on your LOCATIONS table, it can then be referenced by the LOC_ID item on the Master-Detail page, to display the Location Name. You could try doing the following:
    1. Create a new dynamic LOV, LOCATIONS, using a query similar to the following:
    select Name d, ID r
    from LOCATION
    order by 1
    2. Edit the "Create" button on the Master report page, and in the "Optional URL Redirect" section set "Request" to CREATE. Click Apply Changes, to save the setting.
    3. Edit the LOC_ID item on your Master-Detail page, and set the following:
    * in the "Name" region change the "Display As" setting to Select List
    * in the "Label" region change the Label to Location Name.
    * in the "List of Values" region set the "Named LOV" to LOCATIONS
    * in the "Read Only" section, set the condition to Request != Expression 1, and set Expression 1 to CREATE.
    Click Apply Changes to save the settings.
    When you run the pages now, the Location Name field will appear as Read-Only when editing a selected Master row. The item will appear as a Select List when the user clicks "Create" on the Master page, to create a new Master row.
    I hope this helps.
    Regards,
    Hilary

  • Session storage errors in master-detail form

    hi,
    as the sequences do not work in master detail forms, i'm using session variables but the form does not compile and gives error.
    following is my code in the SAVE button of the master-detail form -
    declare
    new_prod_id number(10);
    begin
    select BPSIDEV.PRODUCT_ID_SEQ.NEXTVAL
    into new_prod_id
    from dual;
    p_session.set_value
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_PRODUCT_ID',
    p_value => new_prod_id
    doSave; -- This is generated code
    end;
    the action item values is as foloows -
    Master - INSERT
    Detail - INSERT
    am i missing here something ? or is anything wrong here ?? pls advise ...
    after the above changes the form would not compile at all.
    also how would i populate the the detail records with the foreign key ??
    thanx...
    null

    This problem is fixed in 3.0.8 release of Portal which will be available with the next release of iAS.
    Actuallty the fix is simple look at the generated package of EXAMPLE_MD_FORM from EXAMPLE_APP, onSave event handler looks like this:
    procedure onSave
    p_block_name in varchar2,
    p_object_name in varchar2,
    p_instance in integer,
    p_event_type in varchar2,
    p_user_args in varchar2,
    p_session in out WWV_30898.wwa_api_module_session
    is
    "_master_block" varchar2(30) := 'MASTER_BLOCK';
    Some more code.......
    And then closer to the end in detail processing section there is something like:
    "_d_data_rec".COMM:=p_session.get_value_as_NUMBER(
    p_block_name => "_detail_block",
    p_attribute_name => 'A_COMM',
    p_index => "_cnt"
    "_d_data_rec".DEPTNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_detail_block",
    p_attribute_name => 'A_DEPTNO',
    p_index => "_cnt"
    ===========================================
    You'll need to insert following code, just one if statement, that's it. Please note every time you regenerate the package this code will be lost, so you'll need to add this agains and again. Not a perfect solution, that's why I like JS workaround better.
    ============================================
    if "_d_data_rec".DEPTNO is NULL and "_m_data_rec".DEPTNO is NOT NULL
    then
    "_d_data_rec".DEPTNO := "_m_data_rec".DEPTNO;
    end if;
    ============================================
    ============================================
    if "_detail_action" = 'DELETE' and "_DETAIL_ROWID" is not null then
    DELETE FROM WWV_30898_DEMO.EMP WHERE ROWID = "_DETAIL_ROWID";
    "_detail_deleted" := "_detail_deleted" + 1;
    elsif "_detail_action" = 'UPDATE' then
    UPDATE WWV_30898_DEMO.EMP SET EMPNO="_d_data_rec".EMPNO,ENAME="_d_data_rec".ENAME,JOB="_d_data_rec".JOB,MGR="_d_data_rec".MGR,HIREDATE="_d_data_rec".HIREDATE,SAL="_d_data_rec".SAL,COMM="_d_data_rec".COMM,DEPTNO ="_d_data_rec".DEPTNO WHERE ROWID = "_DETAIL_ROWID" ;
    "_detail_updated" := "_detail_updated" + 1;
    elsif "_detail_action" = 'INSERT' then
    INSERT INTO WWV_30898_DEMO.EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES ("_d_data_rec".EMPNO,"_d_data_rec".ENAME,"_d_data_rec".JOB,"_d_data_rec".MGR,"_d_data_rec".HIREDATE,"_d_data_rec".SAL,"_d_data_rec".COMM,"_d_data_rec".DEPTNO) RETURNING ROWID INTO "_DETAIL_ROWID";
    "_detail_inserted" := "_detail_inserted" + 1;
    end if;
    ............................

  • Procedure in master/detail form

    NOTE: The basic purpose of this procedure is to return records from another table that match records that were just inserted in the detail table.
    My problem is that this procedure processes one set of values at a time. I would like to adapt this procedure to execute after processing a master/detail form that inserts multiple detail records. How and where in the form should I call this procedure to process all the detail records?
    INDT IN VARCHAR2,
    PRIM_REPORTER IN VARCHAR2,
    SEC_REPORTER IN VARCHAR2 DEFAULT NULL)
    as
    begin
    DECLARE
    cursor rpt_cursor is
    SELECT
    F_NAME,
    L_NAME,
    INDT,
    CO_DEFT,
    REPORTER,
    PROCD,
    PROCD_DATES
    FROM NYSPCR.RETURNED_TRANSCRIPTS
    WHERE NYSPCR.RETURNED_TRANSCRIPTS.INDT=INDT
    AND REPORTER=PRIM_REPORTER
    OR REPORTER=SEC_REPORTER;
    rpt_record rpt_cursor%ROWTYPE;
    BEGIN
    OPEN rpt_cursor;
    LOOP
    fetch rpt_cursor into rpt_record;
    exit when rpt_cursor%NOTFOUND;
    htp.p('Our records show that one or more of the transcripts you have just requested may already exist.<P>It appears that co-defendants '||rpt_record.F_NAME||' '|| rpt_record.L_NAME||' or '||rpt_record.CO_DEFT||' already had these minutes transcribed by Court Reporter '||rpt_record.REPORTER||' for this '||rpt_record.PROCD||'proceeding on these dates '||rpt_record.PROCD_DATES||'.<P> Get up off your ass and look for it!');
    end loop;
    end;
    end;

    UPDATE!!!!! I tried to amend the code to loop thru the detail records. Here it goes..feel free to jump in at any time.lol..
    // Set local variables to receive parameters being passed
    //from detail records
    declare
    INDTS VARCHAR2(15);
    PRIM_REPORTERS VARCHAR2(35);
    SEC_REPORTERS VARCHAR2(35);
    p_session portal30.wwa_api_module_session;
    i integer;
    rpt_record rpt_cursor%ROWTYPE;
    begin
    p_session := portal30.wwa_api_module_session.create_session
    ( p_module_id => 51078584518,
    p_version => 1
         i:=1;
    //Print first line of alert.
    htp.p('Our records show that one or more of the transcripts you have just requested may already exist.');
    //Loop through all details records to find any matches as long as INDTS is not null.
    while indts is not null LOOP
         INDTs:= p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_INDT',
    p_index => i
    PRIM_REPORTERs:=p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_PRIM_REPORTER',
    p_index =>i
         SEC_REPORTERs := p_session.get_value_as_varchar2
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_SEC_REPORTER',
    p_index =>i
    cursor rpt_cursor is
    SELECT
    F_NAME,
    L_NAME,
    INDT,
    CO_DEFT,
    REPORTER,
    PROCD,
    PROCD_DATES
    FROM NYSPCR.RETURNED_TRANSCRIPTS
    WHERE NYSPCR.RETURNED_TRANSCRIPTS.INDT=INDTs
    AND REPORTER=PRIM_REPORTERs
    OR REPORTER=SEC_REPORTERs;
    OPEN rpt_cursor;
    LOOP
    fetch rpt_cursor into rpt_record;
    exit when rpt_cursor%NOTFOUND;<P>
    htp.p('It appears that co-defendants '||rpt_record.F_NAME||' '|| rpt_record.L_NAME||' or '||rpt_record.CO_DEFT||' already had these minutes transcribed by Court Reporter '||rpt_record.REPORTER||' for this '||rpt_record.PROCD||'proceeding on these date(s) '||rpt_record.PROCD_DATES||'.');
    i:=i+1;
    end loop;
    end;

  • Requerying on Master Detail form

    Hi,
    Does anyone know how to set up PL/SQL code to automatically requery on a master detail form after insert/update? For example, if I insert a record on the master part of the form, I would like that record to automatically show up after the insert/update. Also, if I insert a record on the detail part of the form, I would like that record to automatically show up after an insert/update.
    Thanks,
    Martin

    Hi Krishnamurthy,
    Thank you very much for the code. The code for the most part acts like I want it to except when I initally insert a master record. In my case, I have the form set up so you have to insert a master record before you can insert any detail records. Therefore, after the user clicks save, that master record needs to come up. The code you gave me only brings up the current master record if you are inserting detail records (which is great, that is what I want it to do). I have modified the code you gave me so when a user is just inserting the master record, the master record automaticaly comes up rather than the first record in the table. However my code makes the form run slow (about 13 seconds to save). Do you know of another way that I can make the form act like I want it to. Below is my code.
    Thanks again,
    Martin
    declare
         l_msg                varchar2(255);
         l_key_value      number(10);
         l_key_value2      number(10);
         v_get_id           number(9);
         v_check_detail      number(9);
         CURSOR GET_ID IS
              SELECT MAX(A.PCH_ID)
              FROM PORTAL30.PCHEADER A;
         CURSOR CHECK_DETAILS IS
              SELECT DISTINCT B.PCD_ID
              FROM PORTAL30.PCDETAILS B WHERE B.PCD_PHC_ID = v_get_id;
    begin
         /*get the key field value from the Master Detail form to requery the details since the form will be cleared out after update */
         l_key_value := p_session.get_value_as_NUMBER(
         p_block_name => 'MASTER_BLOCK',
         p_attribute_name => 'A_PCH_ID',
         p_index => 1
         doSave;--- This is the default handler
         OPEN get_id;
         FETCH get_id into v_get_id;
         CLOSE get_id;
         OPEN check_details;
         FETCH check_details into v_check_detail;
    IF check_details%NOTFOUND
    THEN
         CLOSE check_details;
         /*get the key field value from the Master Detail form to requery the details since the form will
         be cleared out after update */
         l_key_value2 := v_get_id;
         /*get the message which is going to be displayed after update */
         l_msg := p_session.get_value_as_varchar2(
         p_block_name => 'MASTER_BLOCK',
         p_attribute_name => '_STATUS');
         /*now set the key field value in the Master Detail */
         p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
         p_attribute_name => 'A_PCH_ID',
         p_value => l_key_value2,
         p_language => PORTAL30.wwctx_api.get_nls_language);
         WWV_MASTER_GENSYS_1(p_block_name => null,
         p_object_name => null,
         p_instance => null,
         p_event_type => null,
         p_user_args => null,
         p_session => p_session);
         /*put the message(like 'Updated one master record' ) back in the screen */
         p_session.set_value(p_block_name => 'MASTER_BLOCK',
         p_attribute_name => '_STATUS',
         p_value => l_msg);
         p_session.set_value
         (p_block_name => 'MASTER_BLOCK'
         ,p_attribute_name => '_MASTER_ACTION'
         ,p_value => 'NONE');
         p_session.save_session();
    ELSE
         CLOSE check_details;
         /*get the message which is going to be displayed after update*/
         l_msg := p_session.get_value_as_varchar2(
         p_block_name => 'MASTER_BLOCK',
         p_attribute_name => '_STATUS');
         /*now set the key field value in the Master Detail*/
         p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
         p_attribute_name => 'A_PCH_ID',
         p_value => l_key_value,
         p_language => PORTAL30.wwctx_api.get_nls_language);
         WWV_MASTER_GENSYS_1(p_block_name => null,
         p_object_name => null,
         p_instance => null,
         p_event_type => null,
         p_user_args => null,
         p_session => p_session);
         /*put the message(like 'Updated one master record' ) back in the screen*/
         p_session.set_value(p_block_name => 'MASTER_BLOCK',
         p_attribute_name => '_STATUS',
         p_value => l_msg);
         p_session.save_session();
    END IF;
    END;

  • Error in Master Detail Form

    Hi All,
    i m getting the following error when i m creating a master entry ...
    ORA-06550: line 5, column 23: PL/SQL: ORA-02289: sequence does not exist ORA-06550: line 5, column 16: PL/SQL: SQL Statement ignored ORA-06550: line 8, column 16: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 8, column 9: PL/SQL: Statement ignored
    but while creating the master detail form i had specified the corresponding sequences and they even exist in the DB.
    Please ! do help me .
    Thanks & Regards,
    Nandini Thakur.

    Hi ,
    Though u choose the schema name ...the sequence is not appended with the schema name .
    Example you are craeting the application in schema 1 and ur database objects are in schema 2.
    so while creating the Master detail form you will get the option of choosing the schema, but then also the sequence name is not appended (as this may be the problem or bug in apex) .
    so one needs to manually go and append the schema name.
    In master detail form one needs to append it
    1) Form of the Master ...the process called as get primary key there the sequence name should be appended
    ex:- myschema.seq
    2) another is the detail tabular form . here you need to good to the id hidden field and edit it , then in the source column append it with the myschema.seq.
    Regards,
    Nandini Thakur

  • Master detail form Error in mru internal routine: ORA-20001

    Hi,
    i created a master-detail form with apex standrad wizard.
    Master e datail are on the same page.
    All works fine.
    My detail form contain some fields of my detail table.
    Now i added a link on detail form for call a form with all fields of my detail table.
    The link work fine.
    When i try to add row or update my detail form i receive the 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 = "D472A2BF636CA11122F196B8A32B3DC8", item checksum
    Any help?
    Thanks in advance
    Lukx

    Lukx,
    I've just reproduced your what I believe you wanted and didn't receive any errors. Here are the steps I took.
    1) Used the wizards to create a Master Detail form (with Detail edit on the same page as the master and only showing 2 of the detail columns)
    2) Used the wizard to create a FORM ON A TABLE for my detail table allowing the user to edit all detail columns
    3) Created a "column link" column on the detail form of the Master Detail form which links to the FORM ON A TABLE, passing across the ID of the detail record.
    When I do this, everything seems to work perfectly as expected.
    Is there something I'm missing in the steps you performed to create your scenario?
    Thanks
    Doug
    http://www.sumneva.com

  • 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

  • Primary key in master detail form

    i have a situation where i need to access the value of primary key (primary key is hidden) in a master-detail form.
    i need to access the primary key in the javascript onClick event of the button. i'm using the following code in the ...before displaying the form event :-
    htp.p('<script language="JavaScript1.3">
    <!--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    and then i'm calling this javascript in onClick event of the button as follows :
    var_get_val = getField(this.FORM,'PROD_ID');
    this script works for a form with single block but, does not work with the master detail form.
    what is wrong here ... ??
    any ideas or suggestions ...??
    thanx a lot.
    null

    Thank you, Denes,
    but isn_t there a simplier way to use a third column ?
    I will keep your idea in mind and try out as soon as possible.
    With kind regards,
    Hergen.

Maybe you are looking for