Passing values in master detail form

Hi,
I'm using Oracle Database 10g Express Edition.
Application Express 2.1.0.00.39
I've created a Master/Detail Form like this
1. create page
2. Form
3. Master Detail Form
4. selected master table
5. selected fields
6. selected detail table
7. selected fields
Master and Details entries are in different pages.
everything is ok, but i want to pass more than 1 column value from master to detail page. How can i do this?
Thanks and Regards,
Sudha.

Hi,
Values are passed from the master page to the detail page using a column link. By default, the primary key column is passed from the master page to the detail page. To pass further values, add further source columns / target items to the 'Column Link' attribute of your master report's link column.
Hope this helps,
Andrew.
http:///www.apexskins.com

Similar Messages

  • Master-Detail Form (How to pass an item value in Master to Detail field

    I have a Master-Detail form. When adding a new record in the Detail section, I expect the primary key in the master record will copy down to the detail record. But, it is not doing that. Does anyone know how to pass the master primary key down to the detail record field.
    By the way, query works fine. It knows the master-detail relationship. It is just when creating a new detail record, the key not pass down from the master record.
    thanks - Patty

    hi,you can do it by:in detail form's foreign key field,set it's default value as master primary key ,example master page p1,primary key as p1_master,detail form p2,foreign key p2_foreign, set p2_foreign key 's default value &p1_master.
    Message was edited by:
    lixinzhu

  • 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

  • To get value in detail part of master detail form

    hi all
    i am using forms 6i
    there is a master detail form
    in the master part
    i am just mentioning one field as per the requiremnt
    FIELD BELONGS TO DATA BLOCK XXNP_JL_001.FIELD
    this FIELD field is populated by a flexfield NAP_GL_WELL
    VALUES are
    abc                           123
    def                            456
    fgh                            875
    in the master part of the form there is also a button called POPULATE which populates values  for the fields in the detail form
    in the detail part of the form
    i am mentioning two fields
    item_number belongs to data block XXNP_JL_EST_002 and      opn_value belongs to data block XXNP_JL_RES_005
    now the requiremnt is as follows
    say the WELL field has a value 'abc'
    then in the detail part
    whenever and only when the item_number is '1010103002' the opn_value field should have value 123
    similarly when the WELL field has a value 'def'
    in the detail part
    when the item_number is '1010103002' the opn_value  field should display value '456'kindly guide on how this can be achieved
    thanking in advance
    i did a when validate trigger on opn_value field
    BEGIN
    IF  :XXNP_JL_RES_005.OPN_UOM_CODE='PKU' and :XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_RES_005.OPN_VALUE
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
            END IF;
            END;Edited by: makdutakdu on Jul 4, 2012 12:40 PM
    Edited by: makdutakdu on Jul 4, 2012 1:05 PM
    Edited by: makdutakdu on Jul 4, 2012 1:09 PM

    HI
    If i understood your question on overview, your requirement is
    get master details in details column.
    If this is correct,
    YOu can write a simple plsql to get master value in details columne thru trigger
    If my understanding is not correct, please tell me

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

  • How to determine the ROWNUM in a Master Detail Form

    Hello,
    I am working in a Master Detail Form with Orders and Order Items Information; and I created a process that allows the users to select a Product ID on a tabular form, and the next column is populated automatically with the Product Description.
    To achieve that, I followed some instructions by Denes Kubicek (http://apex.oracle.com/pls/otn/f?p=31517:241), but my case is slightly different:
    <ul>I am using a wizard-created tabular form, instead of a manual tabular form; and </ul>
    <ul>Instead of using another page as a Popup to pass the parameter of the ROWNUM, I am using a plug-in called “Tabular Form Super LOV” which is a modified version of the SkillBuilders’ Super LOV that works on Tabular Forms. </ul>
    The Product ID is returned in the correct row by the plug-in; but in the case of the Product Description, it is always returned into the first row; and my problem is that I don't know how to determine the row where the user clicked to call the plug-in.
    I set up an example in apex.oracle.com in case someone would like to look at it:
    Workspace: ediazjorge
    Username: test
    Password: test
    App Name: Sample App
    App Number: 1550
    BTW, I am using Apex 4.1.1.00.23 and Oracle DB 10.3.2.
    Thanks in advance,
    Erick

    Hello VC,
    Thank you for your time and help.
    Unfortunately, it is still not working properly:
    1. When the Popup LOV opens, the first row of the tabular form is 0, the second row is 1, and so on. How can I assign the values starting with 1 and in the format *0001* ? (I am still a novice on Apex and new to JavaScript :-), sorry about that).
    --2. Also, when I close the Popup LOV, the value of P1_ROWNUM is ‘undefined’ again so I'm not sure if the Product Name column will be populated.--
    3. And finally, you are using the jQuery Selector uPopupLOVIcon, which is an attribute of the Cloudy Theme. In my real application (Apex 4.1.1.00.26), my element looks like: *<img src="/i/lov_16x16.gif" width="16" height="16" alt="Popup Lov" alt="List" style="vertical-align:middle;" align="middle" />*. What do you recommend me to use as a jQuery Selector?
    Again, I really appreciate your help and time. I think you solved the most difficult part.
    Thank you so much,
    Erick
    Update: I just found out that the problem with my comment 2 is because I didn’t delete the previous dynamic action that set the value to P1_ROWNUM.
    Edited by: ediazjorge on Sep 18, 2012 11:20 AM

  • Creating Detail record in Master Detail form

    I have created a Master Detail form with the Detail form being on a second page.
    I have no problem editing an existing detail record. However, if I attempt to create a new Detail record (insert). I get an error. It appears that the value of the field that I am linking the Master and Detail records with, does not get passed to the second (detail) form when I press the 'Create' button and I have not been able to ascertain where I may need to modify the parameters of the page.
    Any guidance would be appreciated.

    Hi Judy,
    It's been 5-6 months since I've created a Master/Detail APEX application, but I don't remember having to create any special trigger or anything. I created a few maintenance appls over tables I created, and created an inquiry appl using Oracle vendor tables. All of them have worked nicely.
    If the PK/FK's are set up correctly it just works. :-) Like magic. If I recall correctly, as you create the appl you define the the key fields to use. If the tables are defined correctly, and you 'tie' them together using the correct key fields in the application everything should work nicely.
    Tony

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

  • Query mode of Master Detail Form

    I have a master-detail form.
    I'm passing parameters to that form to autoquery data.
    Everything works fine but "Next" button in a detail block.
    I'm getting:
    An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error: NULL
    index table key value (WWV-16016).
    After autoquery LASTIN_SET variable of DEFAULT block is set "5" (number of rows in detail block).
    When I click on "Next" button LASTIN_SET variable is set to "0" instead of "5" and that causes a problem.
    So, somehow LASTIN_SET is not preserved between clicks.
    In fish_size_form master-detail form
    ... before displaying the page
    shrimp.p_set_parameter_fish_size(p_session,
    p_block_name,
    p_object_name,
    p_instance,
    p_event_type,
    p_user_args
    This is a code of shrimp.p_set_parameter_fish_size
    p_session in out nocopy portal92.wwa_api_module_session,
    p_block_name varchar2,
    p_object_name varchar2,
    p_instance varchar2,
    p_event_type varchar2,
    p_user_args varchar2
    is
    sess_store portal92.wwsto_api_session;
    status varchar2(80);
    station varchar2(80);
    date_time varchar2(80);
    sample varchar2(80);
    species_code varchar2(80);
    form_state varchar2(100);
    begin
    form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE');
    if form_state = 'QUERY_AND_SAVE' then
    sess_store := portal92.wwsto_api_session.load_session(
    p_domain => 'sfnrc',
    p_sub_domain => 'shrimp');
    status := sess_store.get_attribute_as_varchar2(p_name => 'status');
    if status = 'apply' then
    station := sess_store.get_attribute_as_varchar2(p_name => 'station');
    if station is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_O_S_M_O_STATION__ID_K',
    p_value => '='||station,
    p_language => portal92.wwctx_api.get_nls_language );
    end if;
    date_time := sess_store.get_attribute_as_varchar2(p_name => 'date_time');
    if date_time is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_O_IN__SAMPLE_IN__DATE_TIME_K',
    p_value => '='||to_char(to_date(date_time,'yyyy/mm/dd hh24mi'),'yyyy/mm/dd hh24:mi'),
    p_language => portal92.wwctx_api.get_nls_language);
    end if;
    sample := sess_store.get_attribute_as_varchar2(p_name => 'sample');
    if sample is not null then
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_OBSERVED_IN__SAMPLE_NUMBER_K',
    p_value => '='||sample,
    p_language => portal92.wwctx_api.get_nls_language);
    end if;
    species_code := sess_store.get_attribute_as_varchar2(p_name => 'species_code');
    p_session.set_shadow_value(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'A_S_I_PROJECT_SPECIES_CODE_K',
    p_value => '='||species_code,
    p_language => portal92.wwctx_api.get_nls_language );
    sess_store.set_attribute(p_name => 'status',p_value => 'done');
    sess_store.save_session;
    p_session.save_session;
    fish_size_form.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 );
    end if;
    end if;
    end;
    What I'm missing here.
    Aantoliy.

    Say, I click on Update Push button. This will invoke a LOV that will occurs 5 times and then display the header and detail record.
    Even if, I am able to get the records in the canvas, I am not able to update the records of the master. The record_status is in INSERT mode of the header block. Interestingly, if i click 2nd time on update button and then get the records after executing LOV, the query enters the query mode and I am able to update the records then.
    Please suggest how to overcome the problem on a sigle click on UPDATE button.

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

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

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

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

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

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    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;

Maybe you are looking for

  • External Drive Stops Responding [sorry, not FCP related]

    Sorry, I didn't realized I posted this under Final Cut Pro. However, if you have a suggestion, heres the link for the new one: http://discussions.apple.com/message.jspa?messageID=8913406#8913406 Message was edited by: oatmealsnap I have a Western Dig

  • Embedded videos in Interactive PDF play sluggish

    I have created an Interactive PDF using Indesign CS6. It is a 43 page pdf with a video embedded on 5 of those pages. When the final PDF is played on a PC, the videos seems to play sluggishly after watching a previous video. It seems there is some sor

  • Total in Discoverer Plus

    I have created a report in Discoverer Desktop Edition (Version 4.1.44.00.00). The 'Person Code' column has 'Count Distinct Total' and the total has been displayed on the report. When I run the same report in Plus (Release 4.1.44.00.00) the total show

  • Is it possible to turn off the accelerometer?

    is it possible? sometimes it's too annoying especially when you're browsing the website while lying down and you don't want to view it in landscape mode. is there such thing? help thanks

  • Macbook Pro versus Air for university student (pharmacy)

    Hey everyone, So I love all my Apple products, and I plan to get some sort of Mac laptop for university in a few weeks. I'm going to be a pharmacy student at UBC, (so I'm not going into design or video graphics or anything) I basically want a fast, r