Master detail form initial insert issue on details sub-region

Hello,
I created a master detail form with report which should do insertion on master and detail region/subregion.
On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
On EDIT mode it does insertions/updates on master and detail block without problems.
Application Express 4.2.1.00.08
Oracle Database 11g Express Edition Release 11.2.0.2.0
I appreciate your help.
Regards

Something like this should do the work:
CREATE OR REPLACE TRIGGER order_item_table_tr
   BEFORE INSERT
   ON order_item_table
   FOR EACH ROW
BEGIN
   IF :NEW.order_id IS NULL
   THEN
      :NEW.order_id := v ('P1_ORDER_ID');
   END IF;
END order_item_table_tr;
/Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Portal Master-detail form how to auto assign detail record sequence number

    Portal Master-detail form how to auto assign detail record sequence number.Please help me?

    You can just read the following section
    Can I specify a sequence number generator as the default value for a form column?
    Yes. Enter the following in the "default value" field for the column:
    #<schema name>.<sequence name>.nextval
    where <schema name> is the name of the schema containing the sequence, and <sequence name> is the name of the sequence. The entry is preceded by a "#".
    For example, if the schema name is "SCOTT", and the sequence name is "CUSTOMER_SEQ", the default value entry is:
    #SCOTT.CUSTOMER_SEQ.NEXTVAL
    same way you can do for master - detail form.
    for more information on forms please refer the following URL.
    http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm#BuildingApplications
    hope it helps.

  • FRM-40654 error in master-detail form while deleting record in detail block

    Hi,
    I am facing an issue in a custom form which is a Master-detail form while deleting a record in detail block. It is giving an error "FRM-40654 Record has been Updated by another user. Re-query to see change". I have checked the record is matching with that in database.
    Can anyone help on this.
    Thanks In Advance,
    Midhun

    Hi jan,
    master block is based on Table "A" and detail block is based on a View "X".
    View "X" definitions includes the tables "A","B","C" etc..
    Now I have tried removing table"A" from view "X", even then the same error is ocuuring but the lock is happening on table "B" instead of "A"
    Thanks,
    Midhun

  • 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

  • Hashtable for multi part form to insert image and details to database:)

    Hey guys do you have any samples on using hashtable in multipart form to insert image as well as details into database?:)
    Oh it is because my form is using multipart from that enbales me to upload/Insert image into my database.
    Howerver, I also need to insert other details into my database such as productid, ProdName, unitprice.....
    Hence, My tutor suggested using hashtable.
    However, I do not understnd.
    Do you guys have any samples regarding on this?
    Thanks
    :D

    Cathy_Latte wrote:
    However, I do not understnd. More specifically: you do not understand how to use Maps? If so, just go through a book/tutorial on that subject. In fact you should have consulted your tutor or classmates for more information and you're here at a JSP/JSTL forum at the wrong place (you have a problem with Java in general, not with JSP), but OK, here's a link: [http://google.com/search?q=hashmap+tutorial+site%3Asun.com].

  • Master detail form - drop down list in detail (ADF)

    Hi,
    Been racking our brains for a few days/weeks about this one, and would be grateful for any pointers why this does not work.
    We have developed an in-house application for dealing with risk and chemical assessments.
    The process we have adopted allows users to create an assessment first then they are taken to another form where they are then able to add risk factors/ or chemicals relating to the assessment. The intention is to present the user with the ability to select from a drop down list which contains the chemical names.
    We have been going through the forums and have tried all the examples we can find (all the examples work on our system), but when we try to adapt them to our approach they create an error indicating that they cannot find the values in the entity object.
    Has anyone else come across the same problem or is it that the ADF is not suited to dealing with the master/detail approach and drop down menus.
    The drop down lists are in an ADF table.
    Thanks in advance
    Andrew

    Hi Kuba,
    Thanks for the pointer, I think we tried that one early on. For the time being we have opted for using a selectInputText box, and that appears to be working. Well at least it has got us past the deadline for yesterday, now onto the next deadline.
    Thanks again!
    Andrew

  • Adding button to report to link to master detail form

    I want to add a button to a report to direct me to a blank master detail form to insert a new record. I have used the following code in the additional PL/SQL code section:
    htp.formopen('PORTAL30.wwa_app_module.new_instance?p_moduleid=1271601405');
    htp.formsubmit('p_request','Create New');
    htp.formClose;
    When I click this I get 'Page Not Found'.
    But if I hit refresh I am directed to the correct form with the same url.
    Any ideas on what the issue is?
    Thanks.

    Hi,
    Check this sample code.
    tables:sscrfields. "Fields on selection screens
    selection-screen function key 1.
    selection-screen function key 2.
    Initialization.
      sscrfields-functxt_01 = 'Report'.
      sscrfields-functxt_02 = 'Exit'.
    at selection-screen.
       if sscrfields-ucomm = 'FC01'.
      perform f_alv_sub.
       elseif sscrfields-ucomm = 'FC02'.
       endif.
    Hope it helps.

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

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

  • 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 - Problem using built in wizard

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

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

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

  • Master-Detail Forms (Populating a Foreign Key Automatically)

    Master-Detail Form
    When inserting a MD Form, the Master ID (e.g. Deptno,the Primary Key) is generated.
    How is it possible for this also to be generated in the Detail Form (as the Foreign Key)? The requirement is for the foreign key to be populated automatically.
    Any help would be much appreciated.
    Thanks.

    This item is discussed earlier in this group.
    It's solved in version 3.0.8
    Regards,
    Anna

  • Master Detail form - Problems

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

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

  • Master detail form ... EXTREMELY URGENT

    gurus,
    here is my situation -
    i have 2 tables ...
    master ---> base_rate_type
    detail ---> base_rates
    the detail table has base rates for the base rate type in master. the detail can have multiple records but, only one active base rate.
    when the form is run, the user needs to see only the active base rate and on a click of a button the user needs to see the history of all the base rates (all inactive ones and one active).
    this is what i'm doing --
    1. created a view (base_rates_v) of all the active base rates from the detail table.
    2. created a master detail form -
    master ---> base_rate_type
    detail ---> base_rate_v
    the form shows only active records.
    3. created a custom button in the detail. the custom button displays all the records from base_rates table for that master.
    4. HERE IS THE PROBLEM -
    user can enter future base rates (active in future), but the user cannot enter another base rate which would be active rightaway, which means there will be only one base rate ACTIVE at any point of time.
    how would i validate the new base rate against the current ACTIVE BASE RATE ... ?
    i think i could do it in INSTEAD-OF TRIGGER but, then how would i convey the error message back to the user as a ALERT .... ?
    is it possible to alert the user from PL/SQL section of the Portal button ... ?
    any ideas anyone ...
    thanx a lot ...
    null

    dmitry,
    here is what i'm looking for -
    a base rate type can have multiple base rates, each having a start date and a stop date. at any point of time only one of them would be active.
    for example -
    Base rate type --> Type A
    Base Rate Start Date Stop Date
    7.5 10-jan-2001 10-feb-2001
    7 11-feb-2001 10-mar-2001
    8 11-mar-2001 9-jun-2001
    7 10-jun-2001 10-jul-2001
    5 10-oct-2001 10-nov-2001
    so in above case the second last one is active.
    the requirement is when i run the form it should show only active and future base rates. the last one in the above example is future base rate.
    so, i created a view on detail table that shows only active and future base rates. and then a master detail form (the view being the detail). i also created a custom button in the detail section, that would open a report and show all the base rates for a particular base rate type ('A' in above case).
    the VALIDATION that is required in the form is as follows -
    the form displays following -
    Base rate type --> Type A
    Base Rate Start Date Stop Date
    7 10-jun-2001 10-jul-2001
    5 10-oct-2001 10-nov-2001
    if the user enters a new base rate as foll -
    Base Rate Start Date Stop Date
    8 15-jun-2001 15-jul-2001
    then the new base rate overlaps with the existing active base rate. if it so happens i need to ALERT the user that a active base rate already exists for that period.
    how would i achieve this ... ?
    it does not matter if i validate it using JS or pl/sql.
    i was thinking JS would be difficult to use considering, the validation needs to go and check the existing base rates in the table.
    any ideas ...?
    thanx a lot ...
    null

Maybe you are looking for

  • Facebook notifications on taskbar

    I cannot seem to clear my facebook notifications from my taskbar once I have looked at them in facebook.  The icon still stays on the taskbar, just without the astrick next to it.  Please help!

  • Macbook pro dedicated graphics

    So I am completely new to Mac, and I have just purchased a new Macbook Pro with the dGPU. The system has been delivered today, however I am struggling to find the actual dGPU on here, I have gone on to 'about this mac' and it just states the Intel Gr

  • Macbook Headphone Jack

    Music plays fine when I listen to it off the Macbook, put when I go to plug my headphones in, music will come out for a split second, and then nothing. Tried plugging it back in a few times, and still nothing. Any ideas?

  • Upgrading OS

    I have an older MacBook Pro, running OS X  10.5.8. My local support shop tells me they can't help me upgrade any further and I need some basic info about how to proceed. Can my MAC be upgraded or is it too old? If it can be ugraded, where do I obtain

  • Add delay to Route Pattern

    I need the comma equivalent wildcard for Callmanager so I can add a delay before sending additional digits. If I remember correctly you cannot use commas, you have to use another wildcard like &,?, or $ or something. Please Help. Jeremy