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

Similar Messages

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

  • I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    Isn't that only used when a PC will not boot?
    What options does booting with this give me?
    Thanks
    JK MCP
    Hi,
    USB recovery disk was used to recover your system when it encounter problem. You can try to use it to fix your problem instead reinstall system. However, there is no method to keep your program whenreinstall system.
    Roger Lu
    TechNet Community Support

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

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

  • Question about key mapping for bank data in SP3 standard Vendor Repository

    Hello Colleagues:
    The situation is the following:
    1) MDM Standard vendor repository does not use Key Mapping for the qualified table data "Bank Details". This makes sense because normally you would pay a vendor in the same account and bank regardless of the company or R/3 system you are paying him from.
    2) However, here in my project customer don't have the same bank data for all of the 3 R/3 Systems. Furthermore, they would like to pay a vendor in a diferent bank and account number; depending on where the payment is generated (Company or R/3 system).
    Because of this, I though about creating a lookup table for the banks which would use key mapping. I did this and I had no trouble importing bank data in to it.
    Now I have this tables:
    1) Banks: Lookup Flat:
    Country and Bank Key as display fields.
    2) Bank Details: Qualified Flat:
    2.a) Field "Bank" as a non-qualifier display lookup field which points to a record on "Banks" table (Described in number 1).
    2.b) The rest of the fields (Account number, Account holder, Reference, etc.) as qualifier non-display fields.
    This aproach works well in data manager.
    However, when I try to import vendors from R/3, I'm not being able to map the bank details, not even with "compound field" functionality, because I cannot map the display fields in the "Banks" lookup table (Described in number 1); in the "Map Fields/Values" tab in the Destination fields pane, it won't show any fields from this table.
    Also, I'm not very sure if I will be able to syndicate this data back to the R/3 systems correctly, this is; replicate only the banks which exist on each R/3 client system.
    Any ideas on how to solve this problem? Please help.
    Best Regards,
    Jorge.

    ... Where
    did Terminal's default keystrokes (e.g., Esc,[5C for
    ctrl-right-arrow) come from? They just produce
    annoying beeps in bash. Are they standard sequences
    for some shell that I don't know about? I
    Somewhere deep in the bowels of computer history....for example
    http://vt100.net/docs/vt100-ug/table3-6.html
    http://www.termsys.demon.co.uk/vtansi.htm#cursor
    that is to say, these codes date back to early hardware terminals such as the VT100. I believe. And that is why Terminal is a member of a class of software called "terminal emulators".

  • Yet another one about key mapping

    Oracle Forms 6i.
    When I try to copy/paste/cut text with keyboard switched to Russian layout I got the message "FRM-41008: Undefined Function Key"
    How can I change key mapping to use Russian keyboard layout as hotkey for coping/cutting/pasting?
    How can I change mapping for copy/paste/cut function - what Forms function number?
    Thank's

    Hi sorry to hear about the issues your having there, i would recommend you contact the mods here: https://bt.custhelp.com/app/contact_email/c/4951
    They are a special care team who are very good at getting issues resolved. It takes up to 3 days to get a response from them either by email or phone.
    If you want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side If the the reply answers your question then please mark as ’Mark as Accepted Solution

  • About key word return

    Hi;
    Iam very confused about the use of the key word return. I understand its functionality when it returns some value.But what's the case when we use it in the following way:
    if(some testcase)
    return;
    Also where will return leads to when we use only return in a method that has void return type.

    Hi;
    Iam very confused about the use of the key
    word return. I understand its functionality when it
    returns some value.But what's the case when we use
    it in the following way:
    if(some testcase)
    return;:eek:
    IMO a ``test case'' is not a language construct.
    http://en.wikipedia.org/wiki/Test_case

  • About key fields in a table

    Hi,
    I'm actually finding out differences between two tables in remote systems. table name would be given as input parameter, and i'll query the remote SAP system and get the table entries in the remote system and compare them with the table entries in the logon system. Now is there any way, that I can find out which fields are the key fields of table, at run time, having in mind that since everything is at run time, i would be processing using field symbols. So is there anyway to find out which fields in any table are the key fields. Any inputs would be of great help.
    Regards,
    Vijay

    HI vijay
    use the FM
    CALL FUNCTION 'GET_KEY_FIELDS_OF_TABLE'
      EXPORTING
        TABNAME             =<b> <table name></b>
      MANDT_NEEDED        = ' '
      TABLES
        KEY_FIELDTAB        = <b><table to hold the key field ex. data: itab like dfies occurs 0. ></b>
    EXCEPTIONS
      NOT_SUPPORTED       = 1
      OTHERS              = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>Loop at itab.
    write: itab-fieldname.
    endloop.</b>
    regards
    kishore
    Message was edited by: Harikishore Sreenivasulu

  • About key mapping

    Hi,
    Our report server enabled key mapping which includes parameter like userid and server. The key also include paramform=no. Question is can I override the parameters defined in the key entry already by passing it in URL again? For example, for some report, I need paramform=yes?
    Right now it seems to ignore my pass in .
    Thanks
    null

    It has been my experience that any parameter put in the CGI file CANNOT be overidden at runtime. If its there, that's what you get. We discovered the same thing. Our solution: do not include %P in the cgi file but do include %*. The %* allows you to optionally pass any of the parameters in your report. If you want a paramform, then include in the http line '&paramform=html'. If you do not want the parameter form, then do not add this.
    Hope this helps.
    Brett

Maybe you are looking for