I dont want to commit master-detail form untill user press save button

We have department-employee kind of master detail form.
1) We click on any record on department block.
2) Then we change / insert /delete record in employee block.
3) then we move to anothe department.
4) now it ask for saving the changes. THIS WE DO NOT WANT.
5) WE WANT TO SAVE CHANGES WHEN USER CLICK ON SAVE BUTTON.
6) If user make changes to various employees of various department,
we want user to cancel changes when ever user wants.
IN SHORT WHAT WE WANT IS
No record should be saved untill user press save button below.
and If user press cancel all changes made must be undo.
PLEASE DO NOT SUGGEST DO_COMMIT in clear block details,
We know that and we dont want that option.
Regards
Upendra

Hi URTRIVEDI
but it gives "could not reserve record (x tries), keep trying?" error.The problem is not within the code given by Francois but in sessions u opened.
pls make sure u r not running more than one instance of ur form with in one session.
e.g. FireFox is opening more than one tab at a time every modification u made > compile > Generate , Save & Run only one Form instance
Hope this helps...
Regards,
Amatu Allah

Similar Messages

  • Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM

    Hi:
    I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
    form trigger key-commit code is is somehow like this:
    DECLARE
    tot_line NUMBER (3);
    line NUMBER (3);
    begin
    IF NAME_IN ('system.form_status') = 'CHANGED'
    THEN
    GO_BLOCK ('DETAIL');
    LAST_RECORD;
    tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
    FIRST_RECORD;
    line:= 1;
    LOOP
    :detail.quant := :detail.quant + 1;
    EXIT WHEN line= tot_line;
    next_record;
    line:= line+ 1;
    END LOOP;
    FIRST_RECORD;
    GO_BLOCK ('MASTER');
    END IF;
    COMMIT;
    end;
    The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
    But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
    Anyone help?
    Joao Oliveira

    Use PRE-UPDATE trigger (Master block).
    begin
    update <detail_table>
    set quant + 1
    where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
    and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
    and <detail_block_WHERE>;
    EXCEPTION WHEN OTHERS THEN NULL;
    end;

  • Commit master-detail form

    hi all,
    i hava master form and detail table. firstly i commit master form then i want to commit detail table but i cannot commit detail table. i debug frame. And when i commit detail table, prosess cannot reach doDML method. So how can solve that

    Hi,
    appears to me that nobody reads the documentation before coding. Anyway, the documentation is in place and the following chapter explains the solution to your problem
    http://download-uk.oracle.com/docs/html/B25947_01/bcadveo007.htm#CEGJAFCF
    Frank

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

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

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

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

  • Problem in Master Detail form

    Hello I am new to Form Developer and the question I am asking may be very simple for experienced programmers but as I said I am new to forms development so I am finding it a bit hard.
    I have got the following three tables in database.
    1. Student (roll_no, name) Primary key is roll_no
    2. Fee_type(Fee_code, Type, Amount) Primary key is Fee_code
    3. Fee_Receipt(roll_no, Fee_code, Date_of_Payment) roll_no & fee_code are foreign keys
    I want a form containing a combo box filled with all the roll numbers of students, a combo box containing all the fee types and then fields for entering data into fee_receipt table by using text items.
    I dont want to see the names of students, just their roll numbers filled in the combo box. I dont want to see the fee code i just want to see the fee types in the second combo box.
    how would i be able to do that. Any sort of help big or small will be appreciated. Thanks in advance

    Hi,
    Check this out... *[url http://www.holowczak.com/oracle/dev9i/#creatingmasterdetail]Creating Master-Detail Form*
    It is a similar kind of master-detail form. But you have to adapt your requirement accordingly.
    Hope it helps

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

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

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

  • Dynamic action in a report region in a master detail form

    hi
    I have created a master detail form , in which many validation etc is done ,the MASTER is a FORM  and DETAIL is a REPORT
    Now I am stuck up with the detail region .i.e report
    I have Line Detail where there are ITEMS such as SL NO: ,ITEM_ID , UOM ( Unit of measuremnt ) etc
    Now here is where I need help .
    Using POP UP LOV i have managed to fetch in LOV for the item "ITEM_ID",--- i can select an item name using the pop up LOV ,
    Now all that I want is when I select an item name from the pop up lov , an Item Id is displayed or fetched in that particular place , now i want the corresponding UOM to be diaplayed  ( i.e the UOM for that particular Item Id which has been selected by me from the pop up lov ).
    In order to resolve this I created a Dynamic action where in I get the UOM . Bt the problem is that the ITEMS displayed for selecting in the WHEN section (
    DYNAMIC action
    -IDENTIFICATION section
    -WHEN section----- items (  here i am not listed with ITEMS of the REPORT region instead ITEMS of the MASTER is available )
    -TRUE ACTION section etc is only the
    ITEMS of the MASTER region ..
    Please help me sort this out

    Mod: moved from Japanese Apex

  • Master Details Forms- Report getting error

    Dear All,
    I have used master details form . In details form , i am having 50 fields . i am able to add row. after that it is showing error ike below.
    Error:
    =============================================================================
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "D63F13336F2D8570B20FC4825A7B836A", item checksum = "809B7E0170040C75637E80BE2D464C77"., update "SIFY"."REG_MANAGER_DETAILS" set "RMD_ID" = :b1, "RMD_RM_ID" = :b2, "RMD_ACMAN_NAME" = :b3, "RMD_CONN_OT_CUR" = :b4, "RMD_CONN_RS_CUR" = :b5, "RMD_CONN_HW_CUR" = :b6, "RMD_HOST_OT_CUR" = :b7, "RMD_HOST_RS_CUR" = :b8, "RMD_HOST_HS_CUR" = :b9, "RMD_EAS_OT_
    =============================================
    What will be solution to resolve this type of error ?
    Please help me to resolve this. Thanks in advance.
    Regards
    Dhanush.R

    Dhanush,
    This is an optimistic locking checksum error. It's trying to tell you that it can't save because someone/thing has updated the data already and it doesn't want to overwrite it. Is that always occurring?
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Old items are not populated after adding items into a master/detail form

    Hi,
    I am relatively new to APEX. I am creating a master/detail form. It works well. When I add new items the older items are no more populated. Why ?
    For example I have an itme which is a select list as a Named LOV. At creation of the row I want the user to choose from this select list. It works well.
    But when modifying the record, I don't want the user to change this name. For that purpose, I create an item which is a display only item. This item is conditional and appear only when the record has been created.
    And this is where the problem comes. It seems to work but, if I logout of the application and login, then values are no more populated to the items and I get an error when trying to update the form.
    I hope I make it clear. I have been trying a lot of times and found that if I add items, then everything goes wrong.
    Thank you for your kind help.
    Christian

    Hi Christian,
    You don't say what the error is that you are getting - this may help us with your problem!
    On the form, do you now have TWO fields - one being the original select list and the other being a read-only version of it? Is it likely that BOTH fields could appear on the page at the same time AND that both are connected to the field on the table?
    You can set the select list to be read-only conditionally - in this case you could make it read-only on the condition of the primary key field not being null.
    Andy

  • Master Detail Form Question

    I would like to create a master detail form that is essentially 2 tabular report regions. Is this possible?
    Basically I would like to have region A that shows all of the relevant information for higher level items (there are multiple of these higher level items). I would then like to have region B which would show me all of the lower level details for the higher level item that was selected in region A. Is there a way to read the row that you are on in region A and only show those related items in region B?
    Thank you!
    Amber

    Are you asking to create two tabular reports on one page (Reports that are editable), or do you just want two reports on one page (non editable) where you select a row in the first and the second displays the detail records of the selected row in the first, highlighting the the selected row in the first report?
    If you want the two editable reports, then the answer is no, you can only have one tabular form on a page.
    If you only want two reports, or perhaps the top report as a non editable report and the second as an editable report, then it is possible to do this.

  • Master/Detail form with modal edit

    I have a master/detail form that I generated using the wizard that I want to change to have a modal Edit button; i.e. the behavior I want is that the form view is initially read-only and you then have to click an Edit button to make the form editable.
    I figured out how to do this for the master row by making the edit button redirect back to the same page with the request set to 'EDIT' and then making all the page items read-only with a condition REQUEST <> 'EDIT'.
    I cannot find a good way to do this for the detail rows, which are actually a report with editable columns. The problem is that the 'Tabular Form Element' section of the 'Column Attributes' page does not have a read-only condition.
    The only work around I can come up with so far is to have a second read-only report region with the same SQL query and then display either the editable or non-editable report region conditionally depending on whether the request is EDIT. But this obviously not ideal (having same SQL in two places, etc.).
    If anyone can think of a better way to do this, I'd be grateful.
    HTML DB Team: Can you log the addition of a read-only condition attribute on editable report columns as an enhancement request?

    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 Questions

    Master-Detail Form Questions
    I have two questions in regards to master-detail forms:
    First, the form I am working on has 25 detail rows displayed to the user. If the user has more than 25 detail records for the master, I want them to be able to add more. For instance, after they enter the 25th record, I would like a pop up window to ask them if they would like to add more detail records for this master. If they select yes, then the records they have entered would be saved and then the form would repopulate with the current master record and another empty 25 detail records.
    Second, I would like the Detail Action to be set to Insert if the user moves to a new detail row and selects an item from a combo box.
    Thanks for any and all help.
    Jeremy.

    Hi Sharmila.
    Is there a way to repopulate only the Master information without populating the detail after the 'Save' button is pressed? I have written code that uses the session variables and repopulates the form with all the data that has just been saved, but I need only the master without the detail.
    Thanks.

Maybe you are looking for