Master Details form (LOV based on Detail Column of Join Condition)

I have created a master detail form where user_id is joining master and details.
I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
Please advice what should i do.
Thanks
Bakulesh

I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
htp.p('<script language="JavaScript1.3">
function getMstFieldValue(form,fieldName)
var objName = "";
var tmp = "";
var dAction = "";
var sel_idx = 0;
var cnt = 0;
var instance = 0;
var slicedName;
var fillData = new Array();
var blkname;
for(var i = 0; i < form.length; i++)
slicedName = form.elements.name.split(".");
tmp = slicedName[2];
instance = parseInt(slicedName[3],10);
blkname = slicedName[1];
//alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
if (!tmp)
continue;
objName = tmp;
if (objName == fieldName && blkname == "MASTER_BLOCK")
return form.elements[i].value;
function setDetFieldValue(form,fieldName,value)
var objName = "";
var tmp = "";
var dAction = "";
var sel_idx = 0;
var cnt = 0;
var instance = 0;
var slicedName;
var fillData = new Array();
var blkname;
for(var i = 0; i < form.length; i++)
slicedName = form.elements[i].name.split(".");
tmp = slicedName[2];
instance = parseInt(slicedName[3],10);
blkname = slicedName[1];
//alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
if (!tmp)
continue;
objName = tmp;
if (objName == fieldName && blkname == "DETAIL_BLOCK")
form.elements[i].value = value;
</script>');
thanks
Bakulesh

Similar Messages

  • Creating a dynamic lov based on a column

    Hi,
    I want to create a dynamic lov based on a column in a database-table.
    Eg. the query
    'select code, description from code_table'
    is the contents of the column 'lov_query' in the table 'parameters'.
    For every parameter there can be a different lov-query, but the result is always
    two columns (code and description, number and name, etc.), exactly what you need to use in a lov.
    I've written a (dbms_sql) function that takes the parameter-id and returns the lov_query.
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(2000);
    begin
    DBMS_SQL.PARSE
    (cur, 'select pmr.lov_query from parameters pmr where pmr.ID ' || ' = 'L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 2000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0
    THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE     
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    But now I'm stuck on how to pass on this statement in HTMLDB
    as an dynamic lov, I don't seem to be able to execute this statement
    into the two display and return columns. Any ideas?

    Hello again,
    This lov is on an updatable report-column where the user has to make a choice from an non-named, popup and query-based lov. In the lov-query box I have just put:
    "return get_pmr_lov(:p41_param_id)" (without the quotes ;-)
    Here's my latest version plus an alternative, which both seem to work fine:
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    begin
    DBMS_SQL.PARSE (cur, 'select pmr.lov_query from paramaters pmr where pmr.ID ' || '= :L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 1000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0 THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    create or replace function "GET_PMR_LOV2"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    BEGIN
    EXECUTE IMMEDIATE 'select pmr.lov_query from parameters pmr where pmr.ID = :1'
    INTO l_stmnt USING l_pmr_id;
    return l_stmnt;
    END;
    The error-message remains the same, unable to bind :p41_param_id !

  • Master Detail Form with Report - Referring a column in another table

    I have master detail form with a report option. The master table has a column that also references a look up table.
    When the report is displayed the lookup column id is displayed. Rather I want to get the look-up value from a lookup table
    and display in the report.
    When I see the report region Query definition , it just has the columns to add/remove only from the master table.
    Could you pls help me with this regard.
    Eg :
    Dept Table
    dept_id
    dept_name
    location_id
    Employee Table
    employee_id
    employee_name
    dept_id
    location
    location_id_id
    location_name
    Master is Dept, Detail is dept and lookup table is location.

    Simply add the lookup table to the FROM clause and join its PK with the FK in the master table in your query. That's basic SQL, and you definitely must get a good grasp of SQL to do more than very basic work in APEX.
    For a good example, please see http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/build_app.htm#BCEBJJGB
    While you're at it, read and implement the tasks outlined in the 2 Day + Application Express Developer's Guide - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/toc.htm. After that, read the "Oracle Application Express 3.0-- Building a Functional Application" OBE in http://www.oracle.com/technology/obe/apex/obe30/apexdev30.htm - great stuff.
    Georger

  • Master Detail Form - unable to add detail row

    Dear,
    I have a test application that runs for years on apex.oracle.com.
    Since 3rd of june 2010 I am unable to add rows on a detail form.
    Any ideas?
    Help is welcome!
    Kind regards
    Lorenz

    4.0 Conversion Issue
    Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
    I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
    My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
    Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
    Is this a reported 4.0 conversion issue?
    Jeff

  • Master detail forms..increase the detail rows by clicking a button

    hi all,
    i have a problem, in my master detail form i have set the details rows as 8. can i give an option to the user such as a button, on clicking which he can increase the number of detail rows by say 2 or 3.
    can any one help me out on this???
    Thanks in Advance
    Rajesh

    Hi Rajesh,
    This is not posible in the current model of the portal forms , the no of detail rows can be set only at the design time.
    rahul

  • Master-Detail Form - only the first detail record is saved in database

    Hello,
    I have created APEX master-detail form with detail tabular form on the same page.
    I tried to enter data to the several detail rows (using Add Row button) and then press Apply Changes button.
    Unfortunately, only the first detail row is being inserted into the database.
    What could be the reason?
    Thanks in advance,
    Erik

    Hi,
    I had a similar problem.
    Problem with addRow(); function in tabular forms - only first line saved
    Maybe it will help to you.
    Regards
    J :D

  • Dynamic LOV based on report column

    HI,
    I've a standard report with Two columns. Column1 is standard Report Column and Column 2 is a LOV based on an SQL Query.
    Now I need to filter the LOV (add a where clause) based on the value in the column1.
    For example, consider Column1 as "country" and column2 as "state". so the in column2(LOV), user should see only the list of states belongs to the corresponding country(Column1)
    Please note that the report is based on an SQL query
    Any clue on how to do this.
    I'm using APEX4.1.
    Thanks in advance
    Prasanth

    I think you are looking for this https://forums.oracle.com/forums/search.jspa?threadID=&q=tabular+form+cascade&objID=f137&dateRange=all&userID=&numResults=15&rankBy=10001
    please search the forum before posting a question
    Thanks

  • Help needed in Master Detail Form - 2 level of details

    Hi,
    I have a form with 2 levels of Master Detail and a Find window
    The Datablocks are
    - Batch
    - Headers
    - Lines
    - Manual datablock for Find Wndow
    I have created relation between Bacthes and Headers with Batch Id
    I have created relation between Headers and Lines using HeaderId.
    The issue is that,
    If I search with '%' in Batch block, by default it will show results in 'Headers' and 'Lines' block.but if i navigate to the next record in batch block , only Headers block shows results but Lines block does not show result.
    If I search from Find window also, only Batch and Headers block shows results but Lines block will be empty.
    In the 'Batch' block if I search with specific data , the screen shows results in 'Headers' and 'Lines' block.
    Can you please help me solve it.
    I have written a PRE-QUERY on Batches block to set where clause from Find window.
    I have written a PRE-QUERY in Headers block to set where clause from Find window
    Thanks,
    Kamath.
    Thanks,
    Gowtam

    Hi,
    When you execute normal not by searching through ENTER_QUERY mode. Then data is coming in all blocks
    - Yes. Once I go to the Form if I search using '%' in batch block or search for a particlaur record i Batch block, the results shows up in Headers and Lines block.
    Ex: say there are 2 records in Batch block(A and B) and I search by %, by default i get 1 batth record (A) and corresponsding headers and lines
    now when i use down arrow key in the batch block, second record(B) will be showed in batch block. relevant Headers block records will be shown but Lines block does not get queried.
    Similarly if coem to the Form from search window then also, Batch and Header blcoks wil be shown but not Lines block
    PREQUERY at Batch Level_*
    V_WHERE := 'WHERE 1 = 1';
    IF :XXYH_ICAN_CALC_WB_FIND.PERIOD IS NOT NULL THEN
         V_WHERE :=      V_WHERE || ' AND PERIOD = '''||:XXYH_ICAN_CALC_WB_FIND.PERIOD||'''';
    END IF;               
    IF :XXYH_ICAN_CALC_WB_FIND.BATCH_ID IS NOT NULL THEN
         V_WHERE :=      V_WHERE || ' AND BATCH_ID = '''||:XXYH_ICAN_CALC_WB_FIND.BATCH_ID||'''';
    END IF;
    IF      V_WHERE IS NOT NULL THEN
         set_block_property('XXYH_ICAN_WB_BATCHES',DEFAULT_WHERE,V_WHERE );                          
    END IF;     
    PRE-QUERY at Header Level_
    IF :XXYH_ICAN_CALC_WB_FIND.BATCH_ID IS NOT NULL THEN
         V_WHERE :=      V_WHERE || ' AND BATCH_ID = '''||:XXYH_ICAN_CALC_WB_FIND.BATCH_ID||'''';
    END IF;
    IF      V_WHERE IS NOT NULL THEN
    set_block_property('XXYH_ICAN_WB_TRX_HEADERS',DEFAULT_WHERE,V_WHERE );
    END IF;     
    Thanks,
    kamath.

  • Dyanamic form generation based on list columns

    Hello all ,
    How can i create a Sharepoint webpart for List form which is dyanamically create controls based on Selected field in view ...
    Suppose I am having one Sharepoint list ... In that there are 4 columns ...
    A -- as text box , B - Dropdown , C - Choice , D- richtexbox
    and View I have selected only field A,B,D
    Now the in webpart form should be render only with selected control in List view..

    Hi,
    According to your description, you want to create controls dynamically based on the selected view fields.
    You can get the view fields type using SPView.ViewFields Object. Then you can create the control based on the field type.
    More information about SPView Object for your reference:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spview.viewfields.ASPX
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0eb6bf19-e112-432f-87a9-719c8447c66c/get-all-columns-properties-of-the-particular-view-in-the-sharepoint-list?forum=sharepointdevelopmentprevious
    More information about how to create form control dynamically:
    http://zieglers.wordpress.com/2010/04/08/dynamically-creating-form-controls-in-sharepoint/
    As another workaround, you can hide the control which is not in list view in New/Edit form using JavaScript:
    http://www.sharepointdiary.com/2012/12/hide-columns-in-newform-editform-dispforms.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • Master-Detail-Form; Hide/Show columns in detail form depending on column

    Hi,
    i have a master detail form. In the detail form i have the columns:
    ID, MASTER_ID_FK, PC_SOURCE, A_C1, A_C2, A_C3, B_C1, B_C2, B_C3
    The Column PC_SOURCE should be a LOV with values
    NULL
    A
    B
    So if i choose or enter a master record the detail form appears and i can enter one or more detail records.
    PC_SOURCE is the first column.
    If i choose A, the columns B_C1, B_C2, B_C3 should disappear as there should no entry possible.
    If i chhose B, the columsn A_C1, A_C2, A_C3 should disappear as there should no entry possible.
    Is that possible?
    I tried a little on my own but without success. I tried to put into the first column (PC SOURCE lov) in Element Attributes a javascript call like onChange="do_Refresh('#PC_SOURCE#');"
    The javascript funktion do_Refresh tries to catch the column value and set a hidden item P1_SOURCE like document.getElementById('P1_SOURCE').value = v_source;
    But this does not work, as there is not the value of the column fetched.
    And probably can´t work because of the more than one detail rows.
    Thanks & regards,
    Matthias

    Hi,
    The html for your detail form will be a table of input elements with names f01,f02,etc. The columns for the key fields are normally hidden so your PC_SOURCE column will probably use the name f03. The name for column A_C1 will be f04 etc.
    Once you have the input names for your columns you can create a dynamic action (DA) to hide the elements you want.
    You want the DA to fire when any PC_SOURCE element is changed so you want the when to be:
    Event: Change
    Selection Type: jQuery Selector
    jQuery Selector: input[name="f03"]
    Condition: no condition
    The action is to hide an element in the same row if the changed element is a value. So the action should be:
    Action: Execute JavaScript Code
    Fire when Event is: true
    Code: if(this.triggeringElement.value=="A"){$x_Hide('f04_'+this.triggeringElement.id.split('_')[1])}
    You then need lots of true actions for each element you want to hide.
    Rod West

  • Master Detail Form - Update Statement for Column in the Detail Section

    Hello,
    I've posted a demo application to apex.oracle.com
    Application# 49298
    Application Name: Street_Inventory
    Basically, on page 3 I have a Master Detail Form. In the Detail section, I want the value of On_hand to save to table ITEMS. Here's my code below.
    SOURCE
    select
    "CONSUME_DETAIL"."CONSUME_DETAIL_ID",
    "CONSUME_DETAIL"."CONSUME_HEADER_ID",
    "CONSUME_DETAIL"."ITEM_ID",
    "CONSUME_DETAIL"."CONSUMED_QUANTITY",
    ("ITEMS"."ON_HAND" - "CONSUME_DETAIL"."CONSUMED_QUANTITY") as "ON_HAND"
    from "CONSUME_DETAIL",
    "ITEMS"
    where "CONSUME_HEADER_ID" = :P3_CONSUME_HEADER_ID
    and "CONSUME_DETAIL"."ITEM_ID"="ITEMS"."ITEM_ID"
    UPDATE INVENTORY PROCESS
    UPDATE ITEMS
    SET ON_HAND = :P3_ON_HAND - :P3_CONSUMED_QUANTITY
    WHERE ITEM_ID = (select     ITEM_ID
    from     CONSUME_DETAIL
    where CONSUME_DETAIL_ID = :P3_CONSUME_DETAIL_ID);
    My code isn't working. What am I doing wrong?

    WReed,
    The first thing I see "off the bat" is that you don't have items named P3_ON_HAND and P3_CONSUMED_QUANTITY which are referenced in your code. Although it's possible to do what you want with just SQL, I updated your code with a little PL/SQL to make it easier to understand...
    As you'll see the problem now is that the design/db model is not quite right as your getting a too many rows error.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Master-Detail forms no longer work in Access

    Hi
    We have migrated an Access 2000 application into an Oracle 9i database successully. However, the application has a master-detail form that functioned correctly before migration. Since migration the child form does not appear, thus preventing the entering of a new child record.
    Before migration the detail form appeared as a totally blank form. Now the detail form simply doesn't appear. The detail form is based on a select statement which selects data from a stored query. I am suspicious that this is the cause as during tests I have tried manually creating a simple master-detail form and can see this working. I was able to get the test form to fail to produce a blank subform when the subform was based on a select statement however, attempts to change the real form to look at a table rather than a select statement don't solve the problem.
    We have looked on the Oracle forums, but the only error matching our requirements was posted in March 2001 with no real answer (Q: unable to launch subform after migration
    This seems a problem that would not be uncommon so surely we have omitted doing something obvious.
    Any help greatly appreciated.
    Regards
    Tim Broome

    Hello.  I believe I found the answer to the problems yesterday.  After trying everything I could from different forums and getting nowhere, I looked at the Adobe Properties by right clicking on the program.  Once in Properties, there is a compatability tab.  I run Windows 7 Pro 32bit.  Nevertheless, I selected the box that says "Run this program in compatability mode for" and then selected Windows 7.  It seems ridiculous to run the program in compatability mode for the OS I actually have on my system but it has done the trick.  All forms work now and my other PDF issues around the office have been resolved.  The only downside is that some PDF documents are printing slowly, but at least everything works. 
    ps: I first tried running compatabiilty mode for XP but it caused several credentialing issues with my systyem and our network, allowed forms to work, but only if they originated from my system (not the network) and did not allow other PDFs to open. 

  • Help about master detail form

    when i create the master detail form then in the detail report only foreign key column display on detail report.
    please help me

    All it means is that you perhaps skipped selecting the columns for the detail table when creating the form.
    Try creating again and this time select the columns appropriately for Master as well as Detail tables.
    Regards
    PS: Always mention the basic information like Apex version, DB version, etc
    Edited by: Prabodh on Aug 18, 2010 2:12 PM

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

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

Maybe you are looking for