When validate getting fired in Clear_block(No_Validate)

When validate getting fired in Clear_block(No_Validate)
In my button where code for clear block is present there is navigation to some of the blocks where when-validate triggers are present.
As suggested in one of the solutions posted in metalink I cannot set the mouse navigate property of the button to No due to design constraints. Also navigation to other blocks cannot be prevented.
The code in when-validate tests whether the field is null or not.Hence it bombs after a clear block (no validate).
As a work around I created a timer in when validate and placed my code for validation in the whentimer expired trigger.It works fine, but does not seem to be a good patch.
Can you suggest a better solution.
Regards,
Vinson

The code in when-validate tests whether the field is
null or not. Hence it bombs after a clear block (no
validate). In your when-validate, do this first:
If :system.record_status = 'NEW' then
  Return;
End if;
The return causes the when-validate to exit successfully, before it checks the field for null. You will want to place some validation somewhere else (in the key-commit or in the commit button wbp trigger) to ensure your field is not null before a commit is executed.

Similar Messages

  • Issue with When Validate Trigger firing multiple times

    Hi guys,
    I have Designed a Form Personalization on a Form which Fires a concurrent Program (built in:execute Procedure) when a Record is Saved.
    Below are the issues I am facing:
    1.Concurrent Program is Firing Multiple Times after Saving the Record.
    2.2 input Values to Concurrent Program are passed as NULL though I have Data but they are in Different Block of Form.
    Note :I have When Validate trigger on 1 Block but i am trying to pass 2 Values on Another Block as input parameters for Concurrent program.But those values are getting as null when program fires.
    Thanks.

    If EBS then post in {forum:id=475}

  • Form_trigger_failure in when-validate-record fired message three times

    Hello all,
    I have a problem with one of my forms. Indeed, I have used when-validate-record trigger to validate fields block.
    So, when user fills a duplicate I display an error message with two choices. Accept or proceed to change. The action button 1 is impeccable.
    But when the user clicks the button 2 of the message, I raise form_trigger_failure exception. What is strange is that my error message appears three times if I get out of the record by the mouse but once I get out of line by the tab.
    Is there someone who can help me on that?
    Please, find below the code that produce this result :
    IF :CTRL2.MATCH_REC > 1 then
         L_ALERT := SHOW_ALERT('ALERTE_1');
         IF L_ALERT = ALERT_BUTTON1 Then
    NULL;
         elsif L_ALERT = ALERT_BUTTON2 Then
         raise Form_trigger_failure;
         end IF;
    end IF;
    Thank you in advance

    Dear CraigB,
    Thank you for your answer but I still working without success.
    I found that the trigger W-V-R is fired thee times so the value of :CTRL2.MATCH_REC is recalculated every time (as shown by Kevin D Clarke about validating duplicate http://forums.oracle.com/forums/profile.jspa?userID=8905) witch is correct.
    If I affect 0 or null to :CTRL2.MATCH_REC, it's not raising finally the form_trigger_failure (F_T_F), so it's working has button 1.
    Note that I found after catching others exception (exception when others then...) a 100501 non-oracle exception.
    I don't know if my repetition is caused by this exception?
    Note again that, when I put other statement instead of raising F_T_F, it's working fine. His just only when I raise F_T_F that I have this behaviour.
    Do you have any idea ?
    Thanks in advance
    Edited by: pkn87897 on Oct 23, 2008 7:09 AM

  • When-validate-item firing on block level.

    Hi all
    i have six fields and when-validate-item trigger is working on block level, i want to display records in one field,i want when-validate-item trigger work on item level not on block level,any help will be greatly appreciated.
    here is the code.
    When-Validate-Item Trigger.
    declare
         Str_Space VARCHAR2(20);
    begin
    Str_Space := ' ';
    :ins1.ref := :ins1.branch || Str_Space || :ins1.class || Str_Space || :ins1.year || Str_Space || :ins1.serial || Str_Space || :ins1.cno || Str_Space || :ins1.edno;
    end;
    sarah

    Francois Degrelle.
    just look the following code.
    DECLARE
         Str_Space VARCHAR2(20);
    begin
         Str_Space := ' ';
    :ins1.ref := :ins1.branch || Str_Space || :ins1.class || Str_Space || :ins1.year || Str_Space || :ins1.serial || Str_Space || :ins1.cno || Str_Space || :ins1.edno;
    END;
    by using the above code i am passing branch,class,year,serial,cno and edno to Ref column( 1 G01 2009 13112 00 01). and Str_space variable is creating space for each item.i want the above code work at item leavel instead of block level.Is it poassibl?
    sarah

  • Which trigger gets fired when a filed (item) get populated

    Hi,
    Which (item level) trigger gets fired when a filed (item) get populated with data
    Thank you

    Thanks for the responce. But....please read the following and try to understand the probelm.
    I have a screen in Oracle Forms.
    For example the screen is EMP and I have a LOV on item: EMPNO
    After selecting an EMPNO from the LOV, I click on a button and the button's trigger (WHEN-BUTTON-PRESSED)
    populates the remaining items with data related to the EMPNO in the EMPNO item which I selected from the LOV.
    Here is the request: I want the items get populated when I select the EMPNO from the LOV.
    I copied the code from WHEN-BUTTON-PRESSED (which is populating the data into other fields) to the triggers you mentioned
    (pre-text-item, when-new-item-instance, when-validate-item, post-text-item)
    But they are not working (the data is not populating when I select EMPNO from LOV)
    I am a DBA not a developer, but I have to do this. So please help me and let me know how to do this.
    I hope you understand the request.
    Thank you

  • Can we have triggers that get fired when we Query a table?

    Hi All,
    What could be the pricise answer to the following question?
    1. Can we have triggers that get fired when we Query a table?
    2. What the relation of triggers and delete, truncate statement in one line?
    3. What is data modelling? Why is it necessary?
    4. Which are not mandatory but essential files in Oracle?
    Regards,
    AAK

    1. Can we have triggers that get fired when we Query a table?for INSERT, UPDATE and DELETE statement, yes
    for SELECT statement, no.
    Question 2 is not clear for me.
    Question 3 is very very general ...
    4 >Which are not mandatory but essential files in Oracle?
    all database files (initialization file, control files, datafiles, redo log files) are mandatory. What is not mandatory but considered as a (very) bad practice is
    to have only 1 control file and only 1 redo log group with 1 redo log file.

  • When Validate Trigger is getting executed when Execute_query

    i have a data block in which i have 2 text item. i have defined when validate item.
    when the form is starting up i have given execute_query. before fetching the values my when validate item is getting executed. i dont want to do this. can one help me out in this case

    Hi,
    Can you pls. check any initial value is given or not? Otherwise for quick solution you can declare a parameter upon which when-validate will validate the value. You can change value before and after 'EXECUTE_QUERY' statement. This is not a good idea.

  • When validate item not firing when exit with mouse

    Hi
    I have a when validate item tirgger on an item.
    it fires fine when I use tab from keyboard after validating
    but when i navigate to another field with the mouse, the trigger does not fire.
    it only fires when i try to close the window..
    how can i overcome this?
    thanks

    Normally, a WVI trigger ALWAYS runs when you leave a field no matter how you leave it (after you have entered something, of course). If it is not running, then you should check whether you have messed around with Set_Form_Property and Validation_Unit.
    Or maybe you have some code in your key-next-item trigger that runs that makes you think it is the when-validate-item trigger.

  • Clear_block(NO_VALIDATE) validating the record

    Hi ,
    I am facing a issue when my code have
    Clear_block(NO_VALIDATE) ;
    After the clear_block builtin , When-validate-item of that block.item is getting fired. please help me to find why the clear_block(no_validate) is firing the WVI .
    WHEN-BUTTON-PRESSED Trigger Fired:
    Form: OEXOETEL
    Block: ADDRESSES
    Item: CANCEL
    Executing CLEAR_BLOCK Built-in:
    In Argument 0 - Type: Number Value: 11
    WHEN-VALIDATE-ITEM Trigger Fired:
    Form: OEXOETEL
    Block: ADDRESSES
    Item: PHONE_COUNTRY_CODE
    please help

    Mouse navigable is set to No already .
    Keyboard navigable is set to Yes.
    I am making every field on the block as Valid before calling Clear_block(NO_VALIDATE) but still the When-Validate-Item trigger is getting fired.
    please help .. Do When-Validate-Item gets fired when builtin Clear_block(NO_VALIDATE) is used?

  • ORA-01403: no data found ---- FRM-40735: WHEN-VALIDATE-ITEM trigger raised

    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    Code Written on find button as below
    BEGIN
              --XX customized
              if (:ADJ_IP_CTRL.DUE_DT_FROM is null OR :ADJ_IP_CTRL.DUE_DT_TO is null) then
              fnd_message.set_string('Due Date from and Due Date To Must be entered.');
              fnd_message.Show;
              raise form_trigger_failure;
              end if;
         BEGIN     
              go_block('ADJ_INV_PAY');
    clear_block(no_validate);
         for inv_rec in (
                             SELECT v.invoice_num,
              v.invoice_id,
              v.invoice_type,
              v.pay_alone,
              v.exclusive_payment_flag,
              v.payment_num,
              v.amount_remaining,
              --TO_CHAR (v.amount_remaining,fnd_currency.get_format_mask(v.currency_code, 42)) char_amount_remaining,
              TO_CHAR (v.amount_remaining,'FM999G999G999G999G999G999G999G999G990D00') char_amount_remaining,
              ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code)
              discount_available,
              /*TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),
              fnd_currency.get_format_mask (v.currency_code, 42))*/
              TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),'FM999G999G999G999G999G999G999G999G990D00')
              char_discount_available,
              ap_payment_schedules_pkg.get_discount_date (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date)
              disc_date,
              v.always_take_disc_flag,
              v.discount_amount_available,
              v.discount_date,
              v.second_discount_date,
              v.second_disc_amt_available,
              v.third_discount_date,
              v.third_disc_amt_available,
              v.gross_amount,
              v.description,
              v.accts_pay_code_combi_id,
              v.due_date,
              v.REMIT_TO_SUPPLIER_NAME,
              v.REMIT_TO_SUPPLIER_ID,
              v.REMIT_TO_SUPPLIER_SITE,
              v.REMIT_TO_SUPPLIER_SITE_ID,
              v.RELATIONSHIP_ID,
              v.external_bank_account_id,
              ieba.bank_account_num external_bank_account_num,
              ieba.bank_account_name external_bank_account_name
              FROM ap_invoices_ready_to_pay_v v, iby_ext_bank_accounts ieba
              WHERE v.party_id = :pay_sum_folder.party_id /* and v.invoice_num like :adj_inv_pay.invoice_num||'%' */
              AND ( (:pay_sum_folder.payment_type_flag =
              'M')
              OR (:pay_sum_folder.payment_type_flag =
              'R'
              AND v.invoice_type IN
              ('CREDIT',
              'STANDARD',
              'DEBIT',
              'EXPENSE REPORT',
              'MIXED',
              'AWT'))
              OR /*Bug5948003, Bug6069211*/
              (:pay_sum_folder.payment_type_flag =
              'Q'
              /*AND (v.vendor_site_id =
              :pay_sum_folder.vendor_site_id
              OR v.invoice_type =
              'PAYMENT REQUEST')*/
              AND ( (:SYSTEM.LAST_RECORD =
              'TRUE'
              AND :SYSTEM.cursor_record =
              '1')
              OR (NVL (
              v.exclusive_payment_flag,
              'N') =
              'N'
              AND NVL (
              :parameter.pay_alone,
              'N') =
              'N'))))
              AND v.currency_code = :pay_sum_folder.currency_code
              AND v.payment_method_code = :pay_sum_folder.payment_method_code
              AND NVL (v.payment_function, 'PAYABLES_DISB') =
              NVL (:pay_sum_folder.payment_function, 'PAYABLES_DISB')
              AND v.set_of_books_id = :pay_sum_folder.set_of_books_id
              AND NVL (v.future_dated_payment_ccid, -1) =
              DECODE (:parameter.manual_fdp_site_acct_src_flag,
              'Y', NVL (:parameter.site_fdp_account_ccid, -1),
              NVL (v.future_dated_payment_ccid, -1))
              AND v.external_bank_account_id = ieba.ext_bank_account_id(+)
              AND v.due_date BETWEEN :ADJ_IP_CTRL.DUE_DT_FROM and :ADJ_IP_CTRL.DUE_DT_TO
                                  ORDER BY v.due_date, UPPER (invoice_num)          
                        --added 08apr2012 (end)
              removed 08apr2012 ORDER BY UPPER (invoice_num)
              ) loop
                   :ADJ_INV_PAY.INVOICE_NUM := inv_rec.INVOICE_NUM;
    :ADJ_INV_PAY.INVOICE_ID := inv_rec.INVOICE_ID;
    :ADJ_INV_PAY.INVOICE_TYPE := inv_rec.INVOICE_TYPE;
    :ADJ_INV_PAY.EXCLUSIVE_PAYMENT_FLAG := inv_rec.EXCLUSIVE_PAYMENT_FLAG;
    :ADJ_INV_PAY.PAYMENT_NUM := inv_rec.PAYMENT_NUM;
    :ADJ_INV_PAY.AMOUNT_REMAINING := inv_rec.AMOUNT_REMAINING;
    :ADJ_INV_PAY.DISCOUNT_AVAILABLE:= inv_rec.DISCOUNT_AVAILABLE;
    :ADJ_INV_PAY.DISC_DATE := inv_rec.DISC_DATE;
    :ADJ_INV_PAY.ALWAYS_TAKE_DISC_FLAG := inv_rec.ALWAYS_TAKE_DISC_FLAG;
    :ADJ_INV_PAY.DISCOUNT_AMOUNT_AVAILABLE := inv_rec.DISCOUNT_AMOUNT_AVAILABLE;
    :ADJ_INV_PAY.SECOND_DISCOUNT_DATE := inv_rec.SECOND_DISCOUNT_DATE;
    :ADJ_INV_PAY.SECOND_DISC_AMT_AVAILABLE:= inv_rec.SECOND_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.THIRD_DISCOUNT_DATE:= inv_rec.THIRD_DISCOUNT_DATE;
    :ADJ_INV_PAY.THIRD_DISC_AMT_AVAILABLE := inv_rec.THIRD_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.GROSS_AMOUNT := inv_rec.GROSS_AMOUNT;
    :ADJ_INV_PAY.ACCTS_PAY_CODE_COMBINATION_ID := inv_rec.ACCTS_PAY_CODE_COMBI_ID;
    :ADJ_INV_PAY.DUE_DATE := inv_rec.DUE_DATE;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_NAME := inv_rec.REMIT_TO_SUPPLIER_NAME;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_ID := inv_rec.REMIT_TO_SUPPLIER_ID;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_SITE := inv_rec.REMIT_TO_SUPPLIER_SITE;
    :ADJ_INV_PAY.REMIT_TO_SUPP_SITE_ID := inv_rec.REMIT_TO_SUPPLIER_SITE_ID;
    :ADJ_INV_PAY.APS_EXTERNAL_BANK_ACCOUNT_ID := inv_rec.EXTERNAL_BANK_ACCOUNT_ID;               
    --               go_item ('ADJ_INV_PAY.INVOICE_NUM');
    --               EXECUTE_TRIGGER('WHEN-VALIDATE-ITEM');
              validate(record_scope);
              if form_success then
              next_record;
              end if;
              end loop;
              first_record;
         exception
                   when others then
                   raise form_trigger_failure;
              END;
    synchronize;
    END;
    Thanks
    -Krishn

    Hello Krishn,
    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    user12266683 wrote:
    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    ORA-01403: no data found clearly indicate that you have SQL Select statement in WHEN-VALIDATE-ITEM trigger and does not handled EXCEPTION
    add exception in your select statement.
    Hope it's clear..
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.*

  • WHEN VALIDATE RECORD

    DECLARE
         PO_TSF_INDICATOR VARCHAR2(1);
         LOC_TYPE VARCHAR2(10);
         TSF_FROM_LOCATION VARCHAR2(50);
         PO_SUPP NUMBER(10);
         QTY NUMBER(12,4);
    BEGIN
    IF :SYSTEM.RECORD_STATUS = 'CHANGED' THEN
         PO_TSF_INDICATOR := TRIM(:B_REQUEST.LI_PO_TSF_IND);
         LOC_TYPE := TRIM(:B_REQUEST.LI_REQUEST_LOC_TYPE);
         TSF_FROM_LOCATION := TRIM(:B_REQUEST.TI_TSF_FROM_LOC);
         PO_SUPP := TRIM(:B_REQUEST.TI_PO_SUPPLIER);
         QTY := TRIM(:B_REQUEST.TI_FULFILLED_QTY);
    IF PO_TSF_INDICATOR = 'P' THEN
         EMESSAGE('PO_TSF_INDICATOR IS "P" ');
    UPDATE AFE_STORE_ORDERS
              SET PO_TSF_IND = PO_TSF_INDICATOR,
              PO_SUPPLIER = PO_SUPP,
              FULFILLED_QTY = QTY,
              TSF_LOC_TYPE=' ',
              TSF_FROM_LOC=' '
              WHERE ITEM = TRIM(:B_REQUEST.TI_ITEM);
         EMESSAGE('PO-TSF-INDICATOR :' || PO_TSF_INDICATOR);
         EMESSAGE('PO-SUPPLIER:' || PO_SUPP);     
         EMESSAGE('QTY :' || QTY);
         COMMIT;     
    ELSIF PO_TSF_INDICATOR = 'T' THEN
         EMESSAGE('PO_TSF_INDICATOR IS "T" ');
         UPDATE AFE_STORE_ORDERS
         SET PO_TSF_IND = PO_TSF_INDICATOR,
         TSF_LOC_TYPE = LOC_TYPE,
         TSF_FROM_LOC = TSF_FROM_LOCATION,
         FULFILLED_QTY = QTY,
         PO_SUPPLIER = ' '
         WHERE ITEM = TRIM(:B_REQUEST.TI_ITEM);
         EMESSAGE('PO-TSF-INDICATOR :' || PO_TSF_INDICATOR);
         EMESSAGE('LOC-TYPE :' || LOC_TYPE);
         EMESSAGE('TSF-FROM-LOC :' || TSF_FROM_LOCATION);
         EMESSAGE('QTY :' || QTY);
    END IF;
    END IF;
    END;
    This is trigger written in when validate record. Now the problem is, update statement isnt working ....Is it like in when validate record (block level), update command dont work ? And is when validate record trigger (when written at the block level) will fire for each record (if its multi record block) ? Please clarify ..
    Regards
    Message was edited by:
    Seshu

    Hi,
    As suggested by you, I have written the code in on-update trigger (block level)
    EMESSAGE('ON UPDATE TRIGGER');
    :GLOBAL.QTY := TRIM(:TI_FULFILLED_QTY);
    IF :GLOBAL.IND = 'P' THEN
         EMESSAGE('INSIDE "P" LOOP"');
         UPDATE AFE_STORE_ORDERS
         SET PO_TSF_IND = :GLOBAL.IND,
                   PO_SUPPLIER = :GLOBAL.PO_SUPPLIER,
                   FULFILLED_QTY = :GLOBAL.QTY,
                   TSF_FROM_LOC = ' ',
                   TSF_LOC_TYPE = ' '
         WHERE ITEM = TRIM(:B_REQUEST.TI_ITEM);
         COMMIT;
         EMESSAGE('RECORD UPDATED');
    ELSIF :GLOBAL.IND = 'T' THEN
         EMESSAGE('INSIDE "T" LOOP"');
    EMESSAGE(:GLOBAL.IND);
    EMESSAGE(:GLOBAL.QTY);
    EMESSAGE(:GLOBAL.FROM_LOC);
    EMESSAGE(:GLOBAL.LOC_TYPE);                    
    BEGIN     
         UPDATE AFE_STORE_ORDERS
         SET PO_TSF_IND = :GLOBAL.IND,
                   PO_SUPPLIER = null,
                   FULFILLED_QTY = TO_NUMBER(:GLOBAL.QTY),
                   TSF_FROM_LOC = TO_NUMBER(:GLOBAL.FROM_LOC) ,
                   TSF_LOC_TYPE = :GLOBAL.LOC_TYPE
         WHERE ITEM = TRIM(:B_REQUEST.TI_ITEM);
         commit;
         EMESSAGE('RECORD UPDATED');
    EXCEPTION
         WHEN OTHERS THEN
         EMESSAGE(SQLERRM);
    END;     
    END IF;
         ERASE ('GLOBAL.IND');
         ERASE ('GLOBAL.QTY');
         ERASE ('GLOBAL.FROM_LOC');
         ERASE ('GLOBAL.LOC_TYPE');
         ERASE ('GLOBAL.PO_SUPPLIER');
    Tell me how am i to know whether its getting fired or not ? because, i cant see message being populated
    Regards

  • A quick clear_block(no_validate) question

    Hi guys,
    As the title suggest, I have a quick question about clear_block(no_validate). Basically I have a master detail relationship and when I am on the detail block (which is on a seperate canvas than the master block) I have a cancel button which basically does clear_block(no_validate) and then navigates the user back to the master block. My question is that if the user now saves something on the master block will the information in the detail block be wiped clean? ie if the detail block contained information and when I navigated to it i decided I didnt want to make any changes to that information so I hit cancel which does clear_block(no_validate) will the whole detail block be wiped clean and null values saved to the database if the user saves on the master block?
    Thanks for any help I may get.

    786733 wrote:
    Thanks for the response, I appreciate it, and hopefully this next question wont sound stupid, though it probably is a stupid question lol. Ok so I have just pressed cancel on my detail block which has: flushed the detail block without validating the changes, committing the changes, or prompting the end user. I then go to my master block and make changes and save them. Since my detail block has been flushed and all data cleared when I commit my changes from my master block am I committing the cleared down values (ie, null values) from the detail block?
    Thanks again.Hi,
    Straight Answer
    When you clear any block with
    clear_block(no_validate);Nothing will save or commit on that block for the corresponding master record. Any change on master will save if you not clear the master record as well.
    Hope it's clear..
    Hamid
    Mark correct/helpful to help others to get right answer(s).*

  • Problem with when validate trigger

    Hi All,
    I am using oracle forms 10g.
    I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
    I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
    message('enter supplier name') same under every field.
    Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.
    Can any one explain me what i have done wrong. The validation trigger is firing and giving message.
    Regards
    Srikkanth

    Srikkanth.M wrote:
    Hi All,
    I am using oracle forms 10g.
    I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
    I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
    message('enter supplier name') same under every field.
    Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.Hey, Srikkanth
    Once you said
    when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output.again you said
    But the problem is When validate trigger fires when i press tab in PO Amount fieldsSo, i'm not getting you..
    Can you clear it any more ? or any other way..

  • When-Validate-Item and Go_Block/Execute Query dilemma

    Hey there folks -- Probably not a surprise question on this forum. I did try to search for this and came up with a few posts but did not find any solutions. Hopefully, I was also doing the correct way to search on this forum. If this is a post for the nth time on this issue, I apologize.
    So, I have 2 blocks:
    1. Control Block that contains the STUDENT_ID field (Database Item = 'N')
    2. Database block that contains the STUDENT_ID field (Database Item = 'Y' and many other fields)
    My goal is do an Execute_Query if User enters the Student ID and either presses TAB or places the MOUSE in the database block and display the record if it exists. As we know, a Go_Block is not allowed in When-Validate-Item. So, I went one step further to "simulate" this. The problem is that I am still firing the Execute-Query when the record has already been retrieved. Here is what I have so far. So, the Key-Next-Item trigger works fine if User enters a Student ID and presses tab. It also works fine if User clicks on the STUDENT_BK as the When-New-Block-Instance trigger fires which in turn calls the Key-Next-Item. The problem occurs when after record has been retrieved and User clicks on control.student_id and then comes and clicks on the STUDENT_BK, the KEY-NEXT-ITEM trigger fires again.
    Suggestions or pointers would be more than welcome.
    Thanks!
    CONTROL.student_id.Key-Next-Item
      if :control.student_id is not null and :SYSTEM.BLOCK_STATUS != 'CHANGED' then
        next_block;
        clear_block(NO_COMMIT);
        execute_query;
      else
        show_alert('Please enter Student ID');
      end if;
    STUDENT_BK.When-New-Block-Instance
    go_item('control.student_id');
    do_key('next_item');

    Yeah... I wrote before I tried it out. The GET_ITEM_PROPERTY('ITEM', previousitem) didn't work the way I thought it did. After I posted that, I tried it out and it was a complete failure.
    I guess what I am thinking now, is in your STUDENT_BK block, do you only want to EXECUTE_QUERY if the :STUDENT_ID does not match the :CONTROL.STUDENT_ID? If that is true, then all you would have to do is to change your KEY-NEXT logic to include the
    if STUDENT_BK.STUDENT_ID != :CONTROL.STUDENT_ID then
      -- original logic
      go_item('control.student_id');
      do_key('next_item');
    end if;The more I think about it, this should work for you. You said that you had two requirements: Entered a student id in the control block and tabbed or entered the database block. If you add the check of the student id then that should take care of your second requirement. If they enter the database block and the id's don't match then it will execute the query, else they already have the record displayed for them so you don't need to do anything.
    Edited by: MLBrown on Nov 19, 2012 3:08 PM

  • When-validate-item trigger restriction on open form or call form

    W have when-validate-item trigger. I need to place a code here that will bring up a form when the "valid entry" on the item has been made. I am getting a frm-40737:Illegal restricted procedure COMMIT...
    Code snippet on the procedure that I am calling from the when-validate-item:
    IF :System.Form_Status = 'CHANGED' THEN
    Commit_Form;
    end if;
    Call_Form ('MY_FORM', HIDE, NO_REPLACE, NO_QUERY_ONLY,'PARAM');
    Is there a work-around. We also cannot use timers here.
    Any help is appreciated?
    TIA

    Thanks Sudha, I tested and it worked with the key-next-item trigger.
    The only thing though, I was told that the users will not use the enter key when they navigate out of the field, it is either clicking on an exit button or function key F4...so I am still stuck with the same problem.
    This site is really helpful and I hope to receive more ideas.
    Thanks!

Maybe you are looking for