Key-Commit

Hi all,
Can anyone suggest me about
What’s the default parameter in key commit trigger?
Thanking you
Seshu

Seshu,
are you doing an exam and just asking all the questions on the forum? All your questions sound very "exam" like".
Grant Ronald
Forms Product Management
p.s. on line help would answer this.

Similar Messages

  • KEY-COMMIT not firing

    I am working on an Oracle 10g database and am using Oracle Forms Developer 10g to create forms. I have created a new 2 field table in my database:
    CREATE TABLE career_cluster
    (career_cluster_code VARCHAR2(3) NOT NULL
    ,CONSTRAINT career_cluster_pk
    PRIMARY KEY (career_cluster_code)
    USING INDEX
    TABLESPACE GALINDX
    ,career_cluster_desc VARCHAR2(30) NOT NULL
    TABLESPACE galaxy;
    I have also created a form so that users can enter data into this table. I have a career_cluster data block in my form with two items: career_cluster_code (set with a maximum length of 3 in my property palette) and career_cluster_desc (set with a maximum length of 30 in my property palette). Both items are also set in the property palettes to a char data type. In my SQL code (in the form) I always have these two items set as varchar2 with (3) and (30), respectively.
    The form opens fine when I run it, however when I click on my SAVE button my KEY-COMMIT trigger is not fired -- it jumps directly to my ON-ERROR trigger and I get an Oracle ORA-06502 error message. I don't see any inconsistencies in my data types or lengths. Below is my KEY-COMMIT code:
    DECLARE hold_item varchar2(30) := :system.cursor_item;
    hold_record varchar2(10) := :system.cursor_record;
    mess_name varchar2(80);
    mess_text varchar2(80);
    BEGIN
    go_block('career_cluster');
         if (error_code = 40202) then
              goto end_of_trigger;
         end if;
    if :system.block_status = 'CHANGED' then null;
    commit_form;
    if FORM_SUCCESS then null;
    mess_name := 'Transaction Complete';
    mess_text := 'Career Cluster(s) committed to the database';
    DISP_ALERT2(mess_text,mess_name);
    end if;
    else null;
    mess_name := 'No changes to commit';
    mess_text := 'No changes have been made to the Career Cluster Code Table';
    DISP_ALERT2(mess_text,mess_name);
    end if;
    go_item(hold_item);
    go_record(hold_record);
    <<end_of_trigger>>
    null;
    END;
    I put in a DISP_ALERT message right after the BEGIN statement but it never displayed so I don't think this trigger is firing. I also put a similar DISP_ALERT message in my ON-ERROR trigger and that does display, so I know it is going right to my ON-ERROR trigger. Does anyone have any ideas what might be triggering the ON-ERROR?
    Thanks,
    -NTW

    ORA-06502 is a numeric or value error string which is raised when an arithmetic, numeric, string, conversion, or constraint error occurrs. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
    I would suggest you to look at the columns definitions in the table and the form fields/variables data types and lengths and make sure they are same as the backend table columns.
    Also, you don't need to put NULL; after each IF ELSE conditions if you have any other statements.
    I would also suggest that you handle any errors in either exception handler of the block or in the ON-ERROR triggers.
    Try this:
    DECLARE
        hold_item varchar2(30) := :system.cursor_item;
        hold_record varchar2(10) := :system.cursor_record;
        mess_name varchar2(80);
        mess_text varchar2(80);
    BEGIN
        GO_BLOCK('career_cluster');
        IF :system.block_status = 'CHANGED' THEN
            commit_form;
            IF FORM_SUCCESS THEN
                mess_name := 'Transaction Complete';
                mess_text := 'Career Cluster(s) committed to the database';
                DISP_ALERT2(mess_text,mess_name);
            END IF;
        ELSE
            mess_name := 'No changes to commit';
            mess_text := 'No changes have been made to the Career Cluster Code Table';
            DISP_ALERT2(mess_text,mess_name);
        END IF;
        GO_RECORD(hold_record);
        GO_ITEM(hold_item);
    EXCEPTION
      WHEN OTHERS THEN  MESSAGE(TO_CHAR(ERROR_CODE)||'-'||ERROR_TEXT);
      RAISE FORM_TRIGGER_FAILURE;
    END;

  • About Key-Commit

    I have lots of complex validation written on Key-Commit trigger.
    But whenever user tries to clear the form, its asking "Do You
    Want To Save The Changes", if user says yes then Key-Commit
    Trigger is not firing.
    Same thing happens when user press Key-Enterqry, Key-Exit
    button.
    So could u suggest me where can i write my complex validation
    that should fire before commit.
    Note : I can not write in Pre-commit & On-Commit trigger because
    i am having restricted procedure in kEY-COMMIT.
    wILL NEW VERSION OF FORMS FIRES HEY-COMMIT TRIGGER.
    rEPLY SOON
    BHAVESH
    null

    Hi Bhavesh,
    You might have solved your problem by now but if not then a
    suggestion from my end.
    In key-clrfrm trigger
    fire an explicit alert asking if user wants to commit changes
    if user chooses ok to do so then
    use following built-in : do-key('commit')
    which will explicitly fire the key-commit trigger
    hence fulfilling your purpose.
    the following is the source code :
    declare
    al_button number;
    begin
    if :system.form_status = 'CHANGED' then
    al_button := show_alert('c_alert');
    if al_button = ALERT_BUTTON1 then -- OK button
    do_key('commit');
    end if;
    end if;
    clear_form;
    end;
    Hope this solves your problem...
    Regards
    Rashmi
    Bhavesh (guest) wrote:
    : Hi
    : Thanks For reply
    : I can not write restricted procedure like go_item in
    : When-validate-record.
    : Also i have lots of complex validation, flag setting and
    : updatation which should gets fire before commit.
    : Because of restricted form procedure i can not write in pre-
    : commit or when-validate-record, according to me keycommit is
    the
    : correct trigger for all complex validation.
    : Also i am giving u example
    : Try to create simple master-detail form.
    : Make a business rule on form level that at least one child
    : record should present.
    : So how this business rule u will implement using simpest way,
    i
    : know there are lots of way like creating global or parameter
    : variables. but i don't want to use that.
    : My logic for above business rule is as,
    : Create key-commit trigger
    : navigate to detail ---- Restricted proc. go_block('detail')
    : go to the first record ---- Restricted proc. first_record
    : if :field is null then
    : message('at least one child should present') ;
    : raise form_triger_failure ;
    : end if ;
    : commit_form ;
    : so for above validation code which is the alternative trigger
    : Reply soon
    : Bhavesh
    : Fatih Sami KARAKAS (guest) wrote:
    : : Bhavesh Gandhi (guest) wrote:
    : : : I have lots of complex validation written on Key-Commit
    : : trigger.
    : : : But whenever user tries to clear the form, its asking "Do
    : You
    : : : Want To Save The Changes", if user says yes then Key-Commit
    : : : Trigger is not firing.
    : : : Same thing happens when user press Key-Enterqry, Key-Exit
    : : : button.
    : : : So could u suggest me where can i write my complex
    : : validation
    : : : that should fire before commit.
    : : : Note : I can not write in Pre-commit & On-Commit trigger
    : : because
    : : : i am having restricted procedure in kEY-COMMIT.
    : : : wILL NEW VERSION OF FORMS FIRES HEY-COMMIT TRIGGER.
    : : : rEPLY SOON
    : : : BHAVESH
    : : If you write your validation code in the
    : : WHEN-VALIDATE-RECORD trigger then
    : : this trigger fires before KEY-COMMIT.
    : : For KEY-EXIT and KEY-ENTERQRY, you must re-write this
    trigger.
    : : for the first one, write the code as
    : : exit_form(no_commit);
    : : for the second, write
    : : clear_block(no_commit);
    : : enter_query;
    : : Fatih Sami KARAKAS
    : : Turkiye
    null

  • URGENT!  Problems with On-Commit and Key-Commit triggers!!

    Hi there,
    We are having a problem with our form actually saving a value to the database after the commit_form is given.
    When we hit the Save Button (which triggers the Key-Commit, and that in turn triggers the On-Commit trigger) we want a populated global variable to save to the database. Now when we hit Save, we can see the field get populated properly with this Global Variable (Global.Last_Tckt_Read), BUT it doesn't save to the database.
    Here is the code from the On-Commit trigger:
    IF :cg$bf_meter.closing_ticket_issued = 'N'
    THEN
    :CG$bf_meter.opening_meter_reading := :GLOBAL.LAST_TCKT_READ;
    :CG$bf_meter.opening_meter_reading_date := :GLOBAL.LAST_TCKT_DATE;
    :CG$bf_meter.closing_meter_reading_date := :CG$bf_meter.last_ticket_date;
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    ELSE
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    END IF;
    The code in the Key-Commit trigger is just commit_form;. Now, the code from the On-Commit seems to work fine if its in the Key-Commit trigger -- BUT we need to use the On-Commit in case the user exits the Form with the Exit Button on the toolbar or "X" on the title bar (Neither the Exit Button and the "X" will call the Key-Commit trigger).
    Any ideas how we can get this data value to actually SAVE in the database??
    Thanks for any help -- please respond, this deadline has already passed!
    Mike

    Well, I can't say I understand what you want, but:
    1) if you have only commit_form in key-commit - then you do not need this trigger. key-commit will fire when F10 (commit) is pressed, but since it is doing the same - there is no need.
    2) why don't you populate your block values to be saved right in SAVE button trigger and issue commit_form in the same trigger?
    Then you can have key-commit to cover the same functionality for F10 with code:
    go_item('save');
    execute_trigger('when-button-pressed');
    3) I cannot get the point of the "close" stuff - on close you want to check for changes or not? and to allow the user to exit with or without saving?

  • FRM-40735:KEY-COMMIT  ORA-02291 trigger raised unhandled exception

    FRM-40735:KEY-COMMIT ORA-02291 trigger raised unhandled exception. when i tried to save records.
    I am using multi record block , 12 records will display at a time, i am trying to save 1st and 5th record which i changed.
    calling a procedure in key-commit trigger
    PROCEDURE desig_updation IS
    V_count number := get_block_property('employee_master',query_hits);
    BEGIN
    go_block('employee_master');
    first_record;
    for i in 1.. V_count loop
         if((:desig is not null ) and (:new_date is not null) and (:emp_desig<>:desig) and (:new_date >=:emp_desig_date)) then
              :emp_desig :=:desig;
              :emp_grade:=:grade;
              :emp_desig_date:=:new_date;
              :emp_upd_by:=:global.usr;
              :emp_upd_on:=:system.current_datetime;
              if( (:radio_group=2) and (:incr_amt is not null)) then
                   increment_process;
                   end if;
         end if;
         if :system.last_record ='TRUE' then exit;
         else next_record;
         end if;     
    end loop;
    END;
    PROCEDURE commit_action IS
    BEGIN
    desig_updation;
    commit_form;
    IF FORM_SUCCESS THEN
    CLEAR_FORM(NO_VALIDATE);
    EXECUTE_TRIGGER('PRE-FORM');
    END IF;     
    END;
    key-commit-trigger
    commit_action;
    commit_form;
    IF FORM_SUCCESS THEN
    CLEAR_FORM(NO_VALIDATE);
    EXECUTE_TRIGGER('PRE-FORM');
    END IF;
    PROCEDURE increment_process IS
    m_gross_sal number;
    p_rslt varchar2(200);
    p_status varchar2(20);
    BEGIN
    delete from INCR_TEMP where ECODE = :emp_code ;
    m_gross_sal := aod_gross_salary(:emp_orgn,:emp_code,'A');--find current salary
    insert into INCR_TEMP(ECODE , CURR_SAL ,
    INCREMENT_AMT ,TOTAL_AOD,
    STATUS,INCR_TYPE)
    values(:emp_code,m_gross_sal,
    :incr_amt,m_gross_sal+:incr_amt,
    'N','I');
    forms_ddl('commit');
    update_emp_increment(:emp_orgn,:emp_code,
    TRUNC(to_date(to_char(:new_Date,'DD/MM/YYYY'),'DD/MM/YYYY')),null,
    :incr_amt, p_rslt,
    :parameter.p_user,to_date(to_char(SYSDATE,'DD/MM/YYYY'),'DD/MM/YYYY'),'I',
    p_status);
    END;
    thanks,
    rinz

    It seems you are insert some data in child table. For which parent data does not exist. In simple primary key values does not exist while you are trying to insert in foreign key values. check this link.
    http://www.lmgtfy.com/?q=ORA-02291
    -Ammad

  • How to Run sequencially two Key-Commit triggers with different scope

    Hi all
    I have two Key-Commit triggers at form and Block level. Form level trigger is inherited from a library. In block level trigger, I have some additional checks. What I want is, to execute the Block level trigger first and than the form level. I tried working with the override/Before/after property of triggers which does the job of sequencing execution but the Raise Form_Trigger_Failure in the block level trigger doesn't stop the execution of form level trigger. Block level trigger does the checks and display corresponding alerts but than the form level trigger also executes.
    I don't wanna copy the code from Form level trigger to the block level trigger as it is common to whole application and may need some additional coding/ bug fixing later.
    Any help would be appreciated.
    RMA

    Thanks for all the help.
    In Key-Commit trigger I am just setting the Blocks' properties, nothing special, the main checks are in On-Commit trigger. I also understand the work around by using a user defined trigger but, to my knowledge, Oracle doesn't recommend it.
    My form has two datablocks, Parent and a child. The entered quantity in the Master block needs to be verified against the Number of units entered in the child block. If they are not the same, I want the alert and stop execution.
    Now I am using Pre-Insert trigger in the master block but was a little surprised because of the sequencing behavior. My understanding was that RAISE FORM_TRIGGER_FAILURE stops execution of all the code after it even is it is in another trigger/procedure ..but now it appears that I was wrong :-(
    Any suggestions??
    RMA

  • Why KEY-COMMIT didn't response??????????

    why KEY-COMMIT didn't response??????????
    my Program Units is LYH:
    LYH(Package Spec):
    PACKAGE LYH IS
    PROCEDURE EVENT(EVT in VARCHAR2);
    END;
    LYH(Package Body):
    PACKAGE BODY LYH IS
    procedure EVENT(EVT in VARCHAR2) is
    TYPE Array1 IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;
    arr_department_code Array1;
    j2 number:=1;
    BEGIN
    --if EVT='POST-CHANGE' then     
    if EVT='KEY-COMMIT' then
              -- insert into XCT_EQ_PRODUCTIONS
         -- ITEM_NAME)
    --     VALUES
         -- :XCT_EQ_PRODUCTIONS.ITEM_NAME);
         --'lllllllllllllll');
         -- commit;
         FND_MESSAGE.DEBUG('AAAA');     
         go_block('XCT_EQ_PRODUCTIONS');
    first_record;
    j2:=1;
    loop
         arr_department_code(j2):=:XCT_EQ_PRODUCTIONS.DEPARTMENT_CODE;
    exit when :system.last_record='TRUE';
         next_record;     
         j2:=j2+1;
    end loop;     
    for ii in 1..arr_department_code.last loop
              if arr_department_code(ii)=arr_department_code(ii+1) then
                   FND_MESSAGE.DEBUG('two same department');
              --     exit ;
                   RAISE FORM_TRIGGER_FAILURE;
              end if;
    end loop;
    END IF;
    END EVENT;     
    END LYH;
    I call LYH in KEY-COMMIT trigger(Data Blocks)
    LYH.EVENT('KEY-COMMIT');
    why din't show message'two same department is forbidden' when i typed two same department name 'EP4100' i running the form

    yes,
    Oracle E-Business Suite 11i,
    Now Generate the form file ......
    Compile Successful !!!
    i upload the file XWPF539L.fmb ,then run,my code have FND_MESSAGE.DEBUG('two same department is forbidden');
    but din't show message'two same department is forbidden' when i typed two same department name 'EP4100'

  • Question: How does the "KEY-COMMIT" trigger work?

    Hello All,
    What is the “KEY-COMMIT” Trigger for the BLK_UPDATE data block for? When is the Trigger being activated? Where can I find the information regarding the "KEY-COMMIT" Trigger (FYI, I have looked at the ORACLE Form online document and the help in the Forms 6i Builder, but so far I found nothing)?
    Any information regarding to the "KEY-COMMIT" Trigger would be greatly appreciated!
    Thanks in advance,
    Jinlan
    --

    From my other post, I got the following information from Andreas Weiden and just want to share with you all here:
    "If you want the code inside your KEY-COMMIT-trigger executed, you will have to do a DO_KEY('COMMIT_FORM'); instead"
    This information really clarifies the def and use of the "KEY-COMMIT" trigger. Great thanks to Andreas for sharing.

  • Strange behaviour on KEY-COMMIT trigger

    Hallo!
    I'm developing a form on Forms Builder [32 Bit] Version 10.1.2.0.2 and I have the following problem:
    In some of the fields I need to perform a check whether a user inserts correct content type (CAPS + language). To do this I have put on KEY-NEXT-ITEM and POST-TEXT-ITEM triggers on the fields an appropriate function to be executed that gives a suitable message to the user.
    On form level I have a KEY-COMMIT trigger that performs some actions besides commit as well.
    The problem is that if I enter wrong content on the relevant fields and right after I give SAVE (standard menu or toolbar way) I get the message displayed many times (more than the wrong fields) and no commit.
    Any ideas what should I do to eliminate this?
    Many thanks,
    Alexandra

    Thank you very much for the suggestions to use WHEN-VALIDATE-ITEM trigger. It works fine.
    My problem was caused by the code in KEY-COMMIT trigger on form level (following COMMIT;):
    CLEAR_FORM(no_validate);
    do_key('enter_query');
    These 2 lines caused the excessive validation producing multiple messages.
    I replaced with:
    If NOT form_success then
         RAISE Form_Trigger_Failure;
         else
         CLEAR_FORM;
         do_key('enter_query');
    End if;

  • IS THERE ANY WAY TO FORCE KEY COMMIT

    Hi:
    Is there any way in forcing when inserting/updating a record in a block to call KEYCOMMIT. For Example, if the user inserted/updated a record and before saving the user may quit the form. I would like to enforce the keycommit trigger to be called when the form is opted to close.

    Hello,
    Try the following in Key-Exit trigger:
    BEGIN
    IF :system.form_status = 'CHANGED' THEN
    DO_KEY('COMMIT_FORM');
    ELSE
    EXIT_FORM(NO_VALIDATE);
    END IF;
    END;
    Regards,
    George
    Hi:
    Is there any way in forcing when inserting/updating a record in a block to call KEYCOMMIT. For Example, if the user inserted/updated a record and before saving the user may quit the form. I would like to enforce the keycommit trigger to be called when the form is opted to close.

  • DEFAULT&SMARTBAR to commit and F10 Key to commit. Is there a difference?

    I'm using the Menu Module DEFAULT&SMARTBAR in the form. When a user creates a record and uses the SAVE icon validation occurs in the form. However when the user hits the F10 key (save record), sometimes but not always validation in the form is being ignored. Is there a way to synchronize those 2 methods to commit a record?
    We have enabled the key layout for 6i in the frmpcweb.res file. The form version we are using is Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Thanks

    Hi!
    If your key-mapping is like forms 6i client/server, the F10 key executes the key-commit trigger.
    If there is no key-commit trigger in your form, the standard commit_form build-in is beeing executed.
    Regards

  • No commit-message (FRM-40400) == Bug in Headstart

    Hello,
    On committing on or more business rules are violated the 'message-window' appear.
    After correcting the errors and committing the changes i'm not getting the usual
    'commit-message' (FRM-40400). This only happens after on or more business rules are violated.
    This is caused by a bug in the procedure 'QMS$FORMS_ERRORS.PUSH'. Below the solution i have implemented (the complete procedure is displayed). I'm using version 6.5.4.0 of the library 'qmslib65.pll.
    PROCEDURE Push
    ( p_msg IN VARCHAR2
    , p_error IN VARCHAR2 DEFAULT 'I'
    , p_msg_type IN VARCHAR2 DEFAULT ''
    , p_msgid IN NUMBER DEFAULT 0
    , p_loc IN VARCHAR2 DEFAULT '') IS
    -- Purpose Show message to the end-user, standard procedure for the Oracle Forms
    -- Generator of Designer/2000 to pass the display and handling of a message
    -- to a user created procedure.
    -- Usage Called by the Oracle Forms Generator code
    -- Parameters : msg Text message
    -- error ERRor or WARNing
    -- msg_type ORA, API or user TLA
    -- msg_id Id of message
    -- loc Location where error occured
    -- Remarks
    v_msg VARCHAR2(2000) := p_msg;
    v_error VARCHAR2(2000) := p_error;
    v_servermsg VARCHAR2(2000) := DBMS_ERROR_TEXT;
    l_empty_errorrec hil_Message.message_rectype;
    BEGIN
    IF p_msgid != 0
    THEN
    g_errorrec.severity := p_error;
    ELSIF ((SUBSTR (v_msg, 1, 11) = 'API Error: ')) OR
    ((INSTR (v_servermsg, 'ORA-20999') <> 0) AND (v_msg IS NULL)) OR
    (INSTR (v_msg, 'ORA-20999') <> 0)
    THEN
    -- error returned from the API, just display no further action required ?
    HandleServerAPIError (p_msg);
    -- M. Kappel
    /* 11-apr-2001
    - Allow check of v_servermsg even if v_msg contains data.
    - With new-style cdm ruleframe, v_msg contains 'ORA-20998'.
    We never looked at v_servermsg because v_msg was not null.
    - With old-style database trigger business logic, v_msg contains only text.
    If we still never look at v_servermsg, we don't identify that the error is
    a 20998 and therefore we raise an alert 'Transaction Failed' instead of
    showing the 'Errors in this Transaction' window.
    -- ELSIF ((INSTR (v_servermsg, 'ORA-20998') <> 0) AND (v_msg IS NULL)) OR
    -- (INSTR (v_msg, 'ORA-20998') <> 0)
    -- THEN
    On committing on or more business rules are violated the 'message-window' appear.
    After correcting the errors and committing the changes i'm not getting the usual
    'commit-message' (FRM-40400). This only happens after on or more business rules are violated.
    When one or more business rules are violated application error ORA-20998 is raised. To
    detect this DBMS_ERROR_TEXT is used ==> DBMS_ERROR_TEXT contains ALWAYS the text of the
    LAST (dbms-)error (the text contains 'ORA-20998').
    Even when no business rules are violated it's possible that DBMS_ERROR_TEXT contains 'ORA-20998'.
    In that case no FRM-, MNU-, PLS-, SRW-, ORA- or REP-messages are displayed, because the error is
    treated as a voilation of one or more business rules. To avoid this 'v_error = E' is added to the IF-clause:
    when one or more business rule are violated this procedure is called to display an error (p_error ==> E);
    for displaying the FRM-, MNU-, PLS-, SRW-, ORA- and REP-messages this procedure is called to display an
    information (p_error ==> I).
    When Designer generates code to validate p.e. check-constraints it will call this procedure too. See the example
    below:
    IF (:FUNCTIES.MIN_LEEFTIJD < :FUNCTIES.MAX_LEEFTIJD) THEN
    NULL;
    ELSE
    qms$forms_errors.push('CBB-00219', 'E', 'OFG', 0);
    qms$forms_errors.raise_failure;
    END IF;
    In this case the procedure is called to display an error. To avoid that the error is incorecctly treated as a
    violation of one or more business rules '(p_msg_type != 'OFG' or p_msg_type is null)' is added to the IF-clause.
    ELSIF v_error = 'E'
    AND (p_msg_type != 'OFG' or p_msg_type is null)
    AND ( INSTR (v_servermsg, 'ORA-20998') <> 0
    OR INSTR (v_msg, 'ORA-20998') <> 0
    THEN
    HandleServerApplError (p_msg);
    -- error returned from the API, just display no further action required ?
    ELSIF ((INSTR (v_servermsg, 'ORA-20000') <> 0) AND (v_msg IS NULL)) OR
    (INSTR (v_msg, 'ORA-20000') <> 0)
    THEN
    -- error was raised by old Headstart code with raise_application_error
    -- strip ora-20000 : , check if code (get message) or message
    HandleOldHeadstart (v_servermsg);
    ELSIF (SUBSTR (v_msg, 1, 3) IN ('FRM', 'MNU', 'PLS', 'SRW', 'ORA', 'REP'))
    THEN
    HandleOracleError (v_msg, v_error);
    ELSE
         HandleApplError(v_msg, v_error);
    END IF;
    Display_Error (g_errorrec);
    g_errorrec := l_empty_errorrec;
    END Push;

    you can create a KEY-COMMIT form level trigger with the following :
    declare
    msglvl varchar2(3) := :system.message_level ;
    begin
    :system.message_level := 5 ;
    commit_form ;
    :system.message_level := msglvl ;
    end ;
    or put instruction : clear_message; before the commit_form ;

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

  • Oracle Forms 6i - mySQL (Commit Problem)

    Hi,
    i'm using Oracle Forms Builder 6i to connect to mySQL 3.23.49 via
    Oracle Open Client Adapter for ODBC 6.0.5.35.0
    Now I have a problem of controlling which form to commit if more than one form are opened.
    E.g. I need to open 2 forms (eg. A, B) and only want to commit the changes made on Form A
    1.
    I open the forms using the follows (i can't use OPEN_FORM('A', SESSION); since mySQL doesn't support)
    OPEN_FORM('A');
    OPEN_FORM('B');
    2.
    then I changed both forms
    Now the :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are 'CHANGED'
    3.
    I then press my custom save button on form A (triggers KEY-COMMIT). Inside KEY-COMMIT, it calls COMMIT_FORM, then triggers
    ON-COMMIT eventually. In ON-COMMIT, i use the built-in COMMIT to commit the changes.
    Then I found that :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are 'QUERY' which is normal. However both
    forms are committed.
    4.
    So I fixed it by: In ON-COMMIT, add RAISE FORM_TRIGGER_FAILURE; after COMMIT. Although it stops committing changes on another
    form. But :SYSTEM.FORM_STATUS, :SYSTEM.RECORD_STATUS, :SYSTEM.BLOCK_STATUS are still 'CHANGED'. Then I do a EXECUTE_QUERY
    after COMMIT_FORM to change back :SYSTEM.FORM_STATUS, etc to 'QUERY'
    5.
    It works. Only Form A is committed. However when Form A has a lot of records (eg. >500), it affects performance.
    Does anyone know how to solve this problem?
    Any help would be greatly appreciated
    Peter

    The question is not how you disable a key, it might be more how to disable a functionality. What functionality do you want to disable? By default F5 maps to the KEY-MENU-trigger, if thats the function you want to disable, write a NULL; in the KEY-MENU-trigger.

  • On commit - sequence increases

    Hello.
    I would like to know, if there is a way to stop form on error (before commit)?
    My form returns sometimes for some users errors(privileges error or policy check error) on commit (KEY-COMMIT). Nothing inserts into database BUT sequence increments.
    Is there a way to stop the sequence to increase?
    Thanks.

    ...and put a trigger on the audit table, etc.
    If there were a good reason NOT TO use a gapless sequence then suggesting alternative solutions would be helpful. In this case there may be no good reason TO use a gapless sequence but that doesn't mean he should try something else. It's possible and he needs to do it.
    Advance queueing is more efficient but I can't remember how to do it right now. It may be on the web somewhere. Using dbms_lock, in pseudocode:
    o create a table to store the sequences.
    o when a sequence is needed then loop through the table and use the sequence to create a lockhandle.
    o if you can't lock the record then move to the next one.
    o if there are no records available then generate more records into the table (autonomos commit) and loop again.
    o if you manage to lock a record then delete it (no commit).
    o return the sequence to the calling process.
    o when the record which uses the sequence is committed then that sequence will be removed from the sequence table.
    o if the record is rolled back then the sequence will remain in the sequence table.
    not suitable for intense usage and there can be problems if there's a chance of a commit between the call to the sequence routine and the insert of the record. you can get round this by using an 'unused sequences' table but that makes it less efficient - try advanced queueing.

Maybe you are looking for

  • Base de ICMS ST / PIS / COFINS diferente da OV e FATURA

    Olá grupo, Desde a implementação das notas SAP referente ao controle do nro. do FCI no XML, onde tivemos que implementar as notas da CT-e, pois eram pré-requisitos, estamos deparando com o seguinte problema... Num cenário de SD, onde incide IPI, quan

  • JTree: How to set different cell editor for different tree Nodes.

    I have a JTree and I want to set different cell editors for different node depending on some condition. E.g. I want to set ComboBox as editor for leaf node but each leaf node will have its own set of data. Any help or pointer? Thanks in advance Sachi

  • Still having problems saving passwords

    I have followed the instructions contained in: http://support.mozilla.org/en-US/kb/make-firefox-remember-usernames-and-passwords?s=Saving+Passwords&r=5&e=es&as=s But I still cannot get the browser to prompt me to save the password. I have deleted and

  • Handling large files in scope of WSRP portlets

    Hi there, just wanted to ask if there are any best practices in respect to handling large file upload/download when using WSRP portlets (apart from by-passing WebCenter all-together for these use-cases, that is). We continue to get OutOfMemoryErrors

  • How did people make maps like Google map in illustrator??

    Is there a easy way to make them? I'm makeig one, it takes forever to darw them indivualy, how did others draw the whole world so quick??