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

Similar Messages

  • Diffrence between when-validate-item and post-text-item trigger

    What is the Diffrence between when-validate-item and post-text-item trigger, when they are written for the same item and the basic diffrence between when-validate-item and post-text-item trigger.

    Two big differences:
    1. post-text-item is only available to, and only triggered when leaving a text item, whereas when-validate-item is triggered by the forms validation process, and is available for any item type.
    2. p-t-i is a navigation trigger and you cannot invoke it programmatically, whereas the 'validate' built-in can be used to execute validation which fires the w-v-i trigger(s).

  • How to prohibit 'when-validate-item' to be executed...????

    Hi ,
    I have written 'when-validate-item' in a text item. I want this code not to be executed only in one and only one circumstance . In my form , i don't want it to be executed when a button is pressed...
    The problem is that this item has the focus .. so presumably whatever i try to do -go to another item , press a button , e.t.c.- this code would run.....!!!!
    How can i achieve this ...???
    Thanks , a lot
    Simon

    Does the user press this button before or after navigating to the item? If before, then set a global variable when the button is pressed and just read the variable before executing your validation code. If after, then I think you may want to rethink your design. For example, you could turn off validation as the default until some other event occurs.

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

  • How to use first_record or Next_record in WHEN-VALIDATE-ITEM.

    Hi All,
    I have a multi-record block where, in one of the fields I need to add this PL/SQL so that for there is no gaps in sequence for S_type and cer_dl fields.below is the sample of how the record should appear.
    s_type cer_dl seq xyz
    ASD Y 1 N
    ASD Y 2 Y
    ASD Y 3 N
    The program is working perfectly when I use it Key-Next-item but I have to add this pl/sql in WHEN-VALIDATE-ITEM for validating the seq field but as the below program have FIRST_RECORD and NEXT_RECORD this will fail in WHEN-VALIDATE-ITEM.
    My Query is that IS there any other way of replacing FIRST_RECORD and NEXT_RECORD
    in the below program and put this in WHEN-VALIDATE-iTEM of seq field.
    I know its pain to understand the below pl/sql and then answer my query.
    PROCEDURE val_seq IS
    --Validation to check that there is no gaps in sequence for S_TYPE and cer_dl fields
         l_value_to_check varchar2(100);
         l_seq_found number;
         l_curr_sequence number;
         l_new_value varchar2(100);
         l_found boolean:=FALSE;
         l_new_set boolean := FALSE; --s_type and cer_dl are different from previous set.
    begin
         if trim(:b1.s_type) is not null
              or trim(:b1.cer_dl) is not null
         then
         -- Program continues here only if all the items are not null
         -- Get information from record that needs to be validated
         l_value_to_check := trim(:b1.s_type) || ':'|| trim(:b1.cer_dl) ;
         l_curr_sequence := :sequence;
         if :SYSTEM.CURSOR_RECORD = '1' then
              if :sequence <> 1 then ----- to check sequence is entered as 1 in the first record
              message('Error:Sequence should start with 1');
         raise form_trigger_failure;
         end if;     
              go_item('b1.XYZ');
         else
              FIRST_RECORD;
              while :SYSTEM.LAST_RECORD <> 'TRUE'
              loop
              l_found := FALSE;
              l_new_value := trim(:b1.S_type) || ':'|| trim(:cer_dl) ;
    if l_new_value = l_value_to_check then -- If the S_type and cer_dl is same then get sequence
                   l_new_set:= FALSE;
              l_seq_found := :seq;
                        if l_seq_found >= l_curr_sequence then
                             --If sequence is duplicated for S_type and cer_dl 
                   go_item('b1.seq');
                        l_new_set := FALSE;
                        elsif l_seq_found < l_curr_sequence - 1 then
                             --If sequence entered is not in order for S_type and cer_dl  .
                        go_item('b1.sequence');
                        l_found := FALSE;
                        elsif l_seq_found = l_curr_sequence - 1 then
                        -- if sequence is entered in order for S_type and cer_dl
                        l_found:= TRUE;
                        go_item('b1.xyz); --go to next item
                        end if;
              else
                   l_new_set := TRUE;
              end if;
              NEXT_RECORD;
              end loop;
         if l_new_set then
         go_item('b1.xyz'); -- go to next item
         else
         if not l_found then
              warn_alert('Error:Sequence should be in order.');
              go_item('b1.seq');
              raise form_trigger_failure;
         end if;
         end if;
         go_item('b1.xyz'); ---go to next item
    end if;
    end if;
    end;

    Hi Gurus,
    When I say enter-query and put 'IAS' in the s_type field and then do a execute query it brings all the records of 'IAS'.
    Now as I want to update the records, and when I navigate across field(s_type,cer_dl,Seq,xyz) using tab and move the cursor down on second record(IAS N 2 N), what happens is when I navigate to sequence field the cursor jumps to LAST RECORD( IAS Y 3 N ) of LAST field XYZ. I am putting the sample record
    s_type cer_dl seq xyz
    IAS N 1 N
    IAS N 2 N
    IAS N 3 N
    IAS N 4 N
    IAS Y 1 N
    IAS Y 2 N
    IAS Y 3 N
    The cursor moves to last record --IAS -Y -3-N when I tab across the second record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • When-validate-item : too_many_rows

    Hi,
    I have when-validate-item trigger on a field in black which returns multiple rows for some instances. In deed, I need to display the returned value to the user in case of multiple rows as well.
    select campaign_code from campaign_master where campaign_vehicle=:form1.vehicle;If the vehicle is registered for multiple campaigns, I need to display the same to the user.
    Is there any way, I can handle it in an efficient manner.
    Thanks

    I need to display the returned value to the user in case of multiple rows as well.How are you displaying the information to your user? Is there a possibility that the vehicle entered is not used in a campaign? Does your user need to know which campaigns the vehicle is used in or simply how many it is used in?
    If only the number of campaign's I think an LOV that lists the Vehicle and a count of how many campaigns it is used in would work. Set the Validate from List property of your item to yes so if the vehicle is not found the LOV will automatically display.
    If the user needs to see which campaign - if any - the vehicle is associated with, then you could show the list of records in a pop-up window and allow them to choose the record they want from the popup. The tricky part to this option is that you can't call the Go_Item or Go_Block built-ins from the WVI trigger, you can only call Unrestricted built-ins from the WVI. One common work-around to this limitation is to create a 1 millisecond non-repeating timer in your WVI and let the Module When-Timer-Expired (WTE) trigger execute the restricted built-ins for you. If you need this option, search the forum on "create timer" and you will find numerous examples of how to set up a non-repeating timer.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • In Oracle Forms, to run all the When-Validate-Item of all the items at once

    In Oracle Forms, is there any built-in / procedure / function which is used to run all the When-Validate-Item triggers of all the Items at once ?
    I will put it in detail :
    When a form is run and while entering the data..
    when we enter some data and try to move out of that item then the When-Validate-Item trigger of that item is fired and the code in that trigger is executed..
    Similarly there may be many items and many When-Validate-Item triggers correspondigly in a form..
    My requirement is to run all the When-Validate-Item triggers of a form at once when we click a button which is created for that purpose only..
    So is there any built-in / procedure / function (to run all the When-Validate-Item triggers of all the items), which can be called in the When-Button-Pressed trigger of that particular button..
    If any one having any solution/suggestion, please let me know..
    Thanks..
    Edited by: user2938447 on Nov 8, 2010 9:03 PM
    Edited by: user2938447 on Nov 8, 2010 9:12 PM
    Edited by: user2938447 on Nov 8, 2010 10:19 PM

    Hi Sandy,
    Thanks for your suggestion..
    The validations should be done at Item level (When-Validate-Item as usually) and seperately again when a button is pressed.
    So to put all the code in another block-level When-Validate-Item trigger or in any When-Button-Pressed trigger will be duplication of the code.
    Actually I have around 30 Fmbs to be modified and each Fmb is having around 20 Items and almost all Items are having When-Validate-Item trigger.
    So,I wanted to know whether there is any Built-in / Procedure in Oracle Forms which runs all the When-Validate-Item triggers once it is called.
    Thanks..

  • 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 item for a particular item number

    hi all
    i am using forms 6i
    In a master detail form
    the block XXNP_JL_OO1 has 2 fields like
    Manual--checkbox item
    Field--text item (populated from Lov RECORD group names Field)
    the query for the record group of FIELD is
    select flex_value from fnd_flex_values where flex_value_set_id=1009757
    flex value
    abdaly
    wafra
    fintas
    now if we do the query select flex_value, hierarchy_level from fnd_flex_values where flex_value_set_id=1009757
    flex_value hierarchy_level
    abdaly 315
    wafra 200
    fintas 100
    In the detail part
    there is a tabbed canvas one field is ACT_QTY
    ITEM NUMBER                   ACTQTY
    client requirement is whenever the item number is 1010103002 only and the manual checkbox item is ticked the act_qty should return values corresponding to the data in Field
    manual and field belongs to datablock XXNP_JL_001
    ITEM_NUMBER AND ACT_QTY belongs to data block xxnp_jl_est_002
    kindly guide how to proceed with this
    should i do a when validate item trigger in act_qty as follow
    BEGIN
        IF :XXNP_JL_001.Manual IS NOT NULL  and XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
        ELSE
             :XXNP_JL_EST_002.ACT_QTY:=NULL;
        END IF;
    ENDthanking in advance
    Edited by: makdutakdu on May 8, 2012 11:15 AM
    Edited by: makdutakdu on May 8, 2012 11:16 AM
    Edited by: makdutakdu on May 8, 2012 11:23 AM
    Edited by: makdutakdu on May 9, 2012 9:00 AM

    hi
    this is the code i wrote
    when job is manual(check box ticked) and item number=''1010103002' the act_qty as per client requirement as follows
    BEGIN
        IF :XXNP_JL_001.Manual IS NOT NULL  and XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
        ELSE
             :XXNP_JL_EST_002.ACT_QTY:=NULL;
        END IF;
    END;the original code as to how act_qty is populated now
    ORIGINAL CODE OF WHEN VALIDATE ITEM FOR ACT_QTY
    Declare
         V_count   number(10) ; 
    Begin
    SELECT    count(1) into V_count   FROM MTL_SYSTEM_ITEMS
    WHERE   SEGMENT1       = :XXNP_JL_EST_002.item_number
    AND     ATTRIBUTE3     =  'Yes'  ;
    If  V_count >=1    then
    :XXNP_JL_EST_002.CALC_CEMENT_SK   :=      :XXNP_JL_EST_002.act_QTY   ;  
    :XXNP_JL_EST_002.CALC_AMOUNT      :=          :XXNP_JL_EST_002.act_QTY * 94         ;  
    Else
    :XXNP_JL_EST_002.CALC_AMOUNT   :=             :XXNP_JL_EST_002.act_QTY  ;
    end if ;
    end ;      
    -----------------------------------------------------------i want to include the above original code of act_qty in my code in the else clause
    this is wht i tried
    Declare
         V_count   number(10) ; 
    Begin
    IF :XXNP_JL_001.Manual IS NOT NULL  and :XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_EST_002.ACT_QTY
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
            ELSE
            ----------original code of act_qty included below in the else clause-----------------------------
    SELECT    count(1) into V_count   FROM MTL_SYSTEM_ITEMS
    WHERE   SEGMENT1       = :XXNP_JL_EST_002.item_number
    AND     ATTRIBUTE3     =  'Yes'  ;
    If  V_count >=1    then
    :XXNP_JL_EST_002.CALC_CEMENT_SK   :=      :XXNP_JL_EST_002.act_QTY   ;  
    :XXNP_JL_EST_002.CALC_AMOUNT      :=          :XXNP_JL_EST_002.act_QTY * 94         ;  
    Else
    :XXNP_JL_EST_002.CALC_AMOUNT   :=             :XXNP_JL_EST_002.act_QTY  ;
    end if ;
    END IF;
    end ;
    END;i am getting error fnd_flex_values should be declared
    kindly guide me
    thanking in advance

  • FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508

    Hi all,
    In Production instance we have an issue on AP invoice workbench, gives an error (FRM-40735 Post-Query Trigger On Quering Invoice ) when we retrieve the existing invoice data entered.
    For this we compiled the invalid objects and applied the patch according to the metalink id [ID 1209736.1]
    After that we came up with new error FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508.
    Can any one help us
    Thanks
    SAI

    Hi Thanks for the reply we have implemented the following things
    1) Please download and review the readme for Patch 8671468:R12.AP.B
    2) Please apply Patch 8671468:R12.AP.B in a test environment.
    3) Check the file versions , they have to be the same as given below.
    Patch/115/sql/aphanwfb.pls 120.64.12010000.11
    4) Please retest the issue.
    5) If the issue is resolved, please migrate the solution as appropriate to other environments.
    APXINWKB : When Entering Invoice Details, Get Error: FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508 [ID 1284114.1]
    This is done no luck.
    Thanks
    Sai

  • When-validate-item at form level do not fire

    Hi, I wrote a when-validate-item at form level to do same check in all items of a screen and note that this trigger do not fire when executing the form. does someone know why this form-level when-validate item do not fire. Are there some conditions i probably forgot to have? Thnaks very much.

    Hi, if you also have a validate-item trigger on the item itself, this may be overriding the form-level validate item.
    At the ITEM-LEVEL:
    if a when-validate-item trigger exists and the Execution Hierarchy property of the trigger is set to override then the item-level trigger will fire instead of any trigger by the same name at any higher scope.
    So make sure you do not have validate-item triggers at the item or block level that may be overriding the form-level when-validate-item.
    To see the properties of a trigger, highlight the trigger and press F4
    Hope this helps!

  • Issue with WHEN-VALIDATE-ITEM trigger in Forms 6i

    I am working with a form(A) which displays a modal window(B) with some database fields on it when a button on the form was pressed.
    First as soon as I pressed the button on the form A the modal window B appears with the values as (for example)
    Scenario - 0
    field 1 - OTHER
    field 2 - 123-456
    field 3 - 14-JUN-2006
    field 4 - Old Contract
    Scenario - 1
    If field 1 is changed/updated to a value NONE then the remaining fields should grey out and should not allow the user to edit/update those fields. Also it should clear all the data in the fields and should display only blank fields. Now the only updatable field in this case is field 1 which has value NONE at this moment.
    field 1 - NONE
    field 2 - NULL
    field 3 - NULL
    field 4 - NULL
    Only if the user exits the modal window B and clicks on SAVE button which is on the form A then only the data changes are committed to the database tables.
    At this moment I don't want to exit the modal window B which means the data changes are not yet committed to the database.
    Scenario - 2
    Now if field 1 is again changed/updated to a value ANOTHER then the remaining fields has to be populated accordingly using the values from the form A and B and it should allow the user to edit/update the remaining fields in window B.
    field 1 - ANOTHER
    field 2 - 123-456
    field 3 - 14-JUN-2006
    field 4 - Old Contract
    Now if you observe Scenario - 0 and Scenario - 2 only field 1 is differing. Rest of the three fields are same. As I didn't exit from the modal window the changes were not committed to the database.
    If the order of the scenarios is like below:
    Case1 : Scenario - 1 & Scenario - 2
    Case2 : Scenario - 1 & Scenario - 0
    I am able to successfully handle the above two cases as initially the three other fields are set to NULL and the user will be able to update the data and can commit the data.
    If the order of the scenarios is like below:
    Case3 : Scenario - 0 & Scenario - 1
    Case4 : Scenario - 0 & Scenario - 2
    I am also able to successfully handle the above two cases as finally the three other fileds are set to NULL and the user will be not be able to modify them and obviously NULL values will be stored in the database when committed.
    Now the problem is with the following order.
    Case5 : Scenario - 0 & Scenario - 1 & Scenario - 2
    Case6 : Scenario - 2 & Scenario - 1 & Scenario - 0
    In the above cases we can successfully handle until Scenario - 1 but when comes to Scenario - 2 how can we be able to display the data as shown.
    I have tried to perform this using WHEN-VALIDATE-ITEM on field 1. When the field 1 is changed from OTHER to NONE I have assigned NULL to the remaining fields. So it's working fine as I mentioned earlier. Now if I change field 1 from NONE to ANOTHER its allowing to update the remaining fields but its not populating the data.
    Can anyone help with this?
    Thanks for the patience in reading the problem....

    Yes, if you use the debugger as Gerd said you can get and see the data as the code executes line-by-line. You can also use message statements in your code to display the data.

  • Dangers of calling restricted procedures from when-validate-item

    As you'll all know, you cannot call the restricted procedure go_item from within the when-validate-item trigger.
    I've read that it is possible to get round this utilising timers, and I have managed to get this working.
    However, I cannot help but think such procedures must be restricted for a reason. Therefore, I'd like to know if there are any known problems that might arise from implementing timers to call restricted procedures?
    Thanks
    Matthew

    Certain types of triggers can't call restricted procedures because there is internal navigation or validation going on during the trigger execution, and the restricted procedures could mess that up. However, when you use a timer, the restricted procedure doesn't execute until after the trigger has finished, so the internal navigation/validation is complete. Because of this, the timer technique is a safe one. If it's a non-repeating timer, it should have very little effect on network traffic and performance.

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

  • WHEN-VALIDATE-ITEM results at a block/form

    Hello friends at www.oracle.com ,
    as we know, WHEN-VALIDATE-ITEM is a trigger used for item validation. But if I use WHEN-VALIDATE-ITEM at a block, or even at a form (since Oracle Forms editor allows me to add a WHEN-VALIDATE-ITEM trigger at a block/form), what's the effect of it? How will WHEN-VALIDATE-ITEM behave in such situation?
    Thanks, and best regards,
    Franklin Gongalves Jr.

    From forms documentation (ever considered to read it?):
    A trigger must be attached to a specific object in the form, either an item, a block, or the form itself. The object to which a trigger is attached defines the scope of the trigger, and so helps Form Builder decide which trigger to fire when the corresponding event occurs. Not all triggers are relevant to all objects. For example a When-Button-Pressed trigger would not be attached to a display item.
    That means, a when-validate-item-trigger at block level fires for ALL items of the block,
    except those ones who have an own when-validate-item-trigger at item level that has the
    property "Execution hierarchy" set to "override".

Maybe you are looking for

  • Best way to record from analogue camcorder

    I have just purchased a TV@nywhere Master card with MSIPVS.  My main aim is to transfer my analogue 8mm video tapes into digital format.  I am currently running MSIPVS on an 800mhz P3 and the quality is OK but I had hoped for better.  I have chosen t

  • WAN router LAN interface Best practice for speed

    Hello I have an ASR router with a WAN link of 100M. The LAN connection for this router is Gig capable. Should I configure the LAN interface on the router for Gig or would this cause problems with potentially 10 times the data exiting the LAN out to t

  • WSCOMPILE java.lang.ClassNotFoundException error

    Hi there. I know this is something simple but I can't figure out where i'm going wrong. I'm getting the java.lang.ClassNotFoundException error when running the WSCOMPILE utility. Here is my config.xml: <?xml version="1.0" encoding="UTF-8"?> <configur

  • Can't get automatic updates

    When I get an announcement for a software update, I getthe following error message: We have activated the domain ni.com for free access, but we use a proxy server. Please tell me what I need to do to prevent these error messages from coming. Thanks!

  • Audio gaps

    I created a slideshow using pictures and movies and when I preview it on the computer, it is fine.  However, on the burnt dvd the audio cuts out at times or the movie audio is out of sync.  How do I fix this if the preview does not show any problems?