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

Similar Messages

  • Restricting User from creating new records using when-validate-record

    Hi,
    I have a requirement for which I have to restrict he user from creating a record in the Supplier Master form if the suppliier type is 'Affiliate Supplier'.
    I have done the following setups
    Seq 10
    Description Restricting user from creating Affiliate records
    Level Function
    Enabled Yes
    Condition:
    Trigger Event WHEN-VALIDATE-RECORD
    Trigger object VNDR
    Condition "${item.VNDR.VENDOR_TYPE_DISP_MIR.value} is NOT NULL
    and
    ${item.VNDR.VENDOR_TYPE_DISP_MIR.value} LIKE 'Affiliate%'
    Processing Mode BOTH
    Context
    Level User
    Value User Name
    Action Sequence 1
    Type Message
    Action Description Saving Affiliate record
    Language ALL
    Message Type Show
    Message Text You Cannot Create Affiliate records Here
    Action Sequence 2
    Type Builtin
    Action Description Stop Proceesing
    Language ALL
    Action Enabled Yes
    Builtin Type RAISE FORM_TRIGGER_FAILURE;
    This is working good on one instance but when I moved it to another instance
    when I query the form and try to navigate to the bank accounts tab of the form which is based on a differnt block i.e VNDR_USES block, the when-validate-record trigger fires there also and stops the processing.
    Any suggestions on this would be higly appriciated.
    Thanks in Advance.

    Hi Srini,
    Yes, it does work...but in a Form Session if i Create more then one Item, in some cases it fires for the first records and not sleeps for the second.
    Sometimes it doesn't give any response.
    Appreciated if you divert to the link to check the Pacthes for 11.5.10 on Form Personalization.
    Please share any ideas/example if yiou have to achieve the below requirement.
    Requirement:
    Once New record is created , a Custom Procedure should be invoked.
    with out closing Form i am able to create n number of Items, so for every Item it should invoke Custom PLSQL Code on Save.
    Let me know if i can achieve the same in Custom.pll .....as i can use either of Options.(Form Personalization/Custom.pll)
    Thanks & regards,
    Edited by: user632004 on Mar 16, 2010 7:50 PM
    Edited by: user632004 on Mar 16, 2010 8:09 PM

  • Equivalent command in OAF for when when validate record in forms

    Hi,
    what is the equivalent command in OAF to when when validate record in forms
    kumar

    Hi Kumar,
    validateRow() of your XXVORowImpl is equivalent of When-Validate-Record of forms.
    This method calls validateEntity() of your XXEOImpl
    This method is generally invoked on form submits (POST Requests)
    Regards,
    Ravi

  • Form personlization using WHEN-VALIDATE-RECORD to call PLSQL Package

    Hi
    I am writing a Form Personalization on master Item Form for New Records Only.
    Once Item Is defined and saved, it should Invoke the Custom Procedure to insert the same record in Custom Table.
    ===========
    Trigger Event - WHEN-VALIDATE-RECORD
    Trigger Block:MTL_SYSTEM_ITEMS
    Condition: :MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID<>-1 AND 0=(SELECT COUNT(inventory_item_id ) FROM Custom table
    WHERE inventory_item_id = :MTL_SYSTEM_ITEMS.inventory_item_id
    AND Organization_id=:MTL_SYSTEM_ITEMS.organization_id )
    ACTION
    Built In type = Execute Procedure
    Argument = ='DECLARE
    v_field_value VARCHAR2(200);
    BEGIN
    UPDATE_CUSTOM('''||${item.MTL_SYSTEM_ITEMS.ORGANIZATION_ID.Value}||''','''||${item.MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID.Value}||''');
    END'
    ============
    Here its not firing as required for evey required.
    Please advice.
    Thanks in advance.

    Hi Srini,
    Yes, it does work...but in a Form Session if i Create more then one Item, in some cases it fires for the first records and not sleeps for the second.
    Sometimes it doesn't give any response.
    Appreciated if you divert to the link to check the Pacthes for 11.5.10 on Form Personalization.
    Please share any ideas/example if yiou have to achieve the below requirement.
    Requirement:
    Once New record is created , a Custom Procedure should be invoked.
    with out closing Form i am able to create n number of Items, so for every Item it should invoke Custom PLSQL Code on Save.
    Let me know if i can achieve the same in Custom.pll .....as i can use either of Options.(Form Personalization/Custom.pll)
    Thanks & regards,
    Edited by: user632004 on Mar 16, 2010 7:50 PM
    Edited by: user632004 on Mar 16, 2010 8:09 PM

  • Frm-40735: when validate record trigger raised unhandled exception ORA-0406

    while on production when i open any form and inserting some valeus after that when i want ot save the information it is showing me following error
    frm-40735: when validate record trigger raised unhandled exception ORA-04062

    ORA-04062: %s of string has been changed Cause: Attempt to execute a stored procedure to serve an RPC stub which specifies a timestamp or signature that is different from the current timestamp/signature of the procedure.
    Action: Recompile the caller in order to pick up the new timestamp >
    Check the When-Validate-Record trigger in your form and look for any calls to a database stored procedure. Then check the status of the database procedure to ensure it is "Valid." If the procedure is not valid - find out why and fix it.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • 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

  • Form trigger failure in WHEN-VALIDATE-RECORD still saves data

    Hi, I have a WHEN-VALIDATE-RECORD trigger on one of my data blocks. When there is an problem with the data, I use RAISE FORM_TRIGGER_FAILURE. The error dialog appears, but it's still saving the data to the database!
    Here is the code for the WHEN-VALIDATE-RECORD trigger:
    -- WHEN-VALIDATE-RECORD Trigger for WTL_USERS Block in form MANAGE_ACCOUNTS
    DECLARE
         v_user_name VARCHAR2(10);
         v_alert_button NUMBER;
    BEGIN
              -- Check if this is the ADMIN account
              -- If it's a new account an error will occur - this is OK, nothing happens
              SELECT user_name
              INTO v_user_name
              FROM wtl_users
              WHERE user_id = :WTL_USERS.USER_ID;
         -- If this is the ADMIN account, you cannot disable it
         IF v_user_name = 'ADMIN' THEN
              -- Ensure that the ADMIN account has not been disabled
              IF :WTL_USERS.USER_ACTIVE = 'N' THEN
                   v_alert_button := SHOW_ALERT('ADMIN_ACTIVE_ALERT');
                   RAISE FORM_TRIGGER_FAILURE;
              ELSIF :WTL_USERS.USER_NAME != 'ADMIN' THEN
                   v_alert_button := SHOW_ALERT('ADMIN_NAME_ALERT');
                   RAISE FORM_TRIGGER_FAILURE;
              ELSIF :WTL_USERS.USER_ROLE != 'A' THEN
                   v_alert_button := SHOW_ALERT('ADMIN_ROLE_ALERT');
                   RAISE FORM_TRIGGER_FAILURE;
              END IF;
         END IF;
    EXCEPTION
         WHEN OTHERS THEN
              NULL;               
    END;
    What am I doing wrong?
    Thanks
    Adam

    Hello,
    Exception
      When form_trigger_failure Then
          Raise
      When others Then
    The when others exception trap all the exceptions including form_trigger_failure.
    Francois

  • When-validate-record trigger only if  a non database item is changed

    Hi,
    I am trying a code in the when-vaidate-record trigger in the BLOCK level.
    The trigger should fire only if a checkbox item value is ticked(Value ='Y) for the present record(i.e, if already existing other records have a value ticked (='Y), it doesnt matter and trigger shouldnt fire)
    Please help me achieve this :
    The code I have tried in when-vaidate-trigger, which does not work as what I want :
    DECLARE
    X NUMBER;
    BEGIN
    if
      nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and :SYSTEM.RECORD_STATUS ='CHANGED'
         then
        set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;
    END;The above code does not fire at all..
    If I remove the part,
    and :SYSTEM.RECORD_STATUS ='CHANGED'
    it fires for "all records"(not just the currently changed records) where nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
    Please help !!
    Note: :DEFLOC.to_be_defaulted is a non database item ; :DEFLOC.COMMENTS is a database item

    Hi kriti,
    There is one more way,
    In the when-checkbox-changed trigger,
    if :your_chk_box = 'Y' then
    set_Record_property(:system.cursor_Record, 'your_blk',status,changed_Status);
    else
    set_Record_property(:system.cursor_Record, 'your_blk',status,Query_Status);
    end if;
    Then it is easy for you to find out the changed records using get_Record_property((:system.cursor_Record, 'your_blk',status)
    Hey let me ask you one Question, is that check_box item is database item ???
    If so,
    it is easier..the fol. code will work for that
    if   nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
      and nvl(get_item_property('DEFLOC.to_be_defaulted',database_value),'N') = 'N'      then
                      set_alert_property(
             'err_alert',
             alert_message_text,
             'You must enter a comment when defaulting localities.');
              x := show_alert('err_alert');
              RAISE FORM_TRIGGER_FAILURE;
              end if;otherwise
    If your are creating that temp. item, it should be in the same block as non-db item.
    I will explain this... You are setting the status of to_be_defaulted check box of some queried record to Y based on some conditions, right?
    These records anyways are not updateable. Now your requirement is to find out the newly checked check boxes.
    So in the post query or the place where you set to_be_defaulted as 'Y, we will default the new item with value Y, so that in the when validate trigger, you
    know which record needs to attacked, It is those records with nvl( new item ,'N') = 'N' and to_be_defaulted = 'Y'...
    Regards
    Dora...

  • Problem while handling When-Validate-Record Trigger in Forms 6i

    I am using below mention code in when validate trigger and use go block loop in when button pressed. if Check_Date_Range gives RAISE Form_Trigger_Failure error user will enter in a loop. kindly provide me solution for below mention problem.
    BEGIN
    Check_Date_Range(:Experiment.Start_Date,:Experiment.End_Date);
    END;
    ** The procedure looks like this
    PROCEDURE Check_Date_Range( d1 DATE, d2 DATE ) IS
    BEGIN
    IF d1 > d2 THEN
    Message('Your date range ends before it starts!');
    RAISE Form_Trigger_Failure;
    END IF;
    END;

    You have more chance to find a response if you post into Forms<br>
    <br>
    Nicolas.

  • Need code for this Small validation on when-validate-item

    Hi All,
    I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
    1) It Cannot be "blank"
    2) It cannot be "Not older than today"
    can you please put me code for this small validation. I am new to Forms.
    Thanks in Advance,
    Reddy

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

  • Save required when adding record to avoid multiple record entries@same time

    Hello, just wondering if anyone would be so kind as to help me out. I have a small problem that when a user is adding records to my form I want them to add one, then if they go on to add another at the same time (before commiting the first one) that they will be shown a prompt Which states something along the lines of "Before you add another record you must first save the first record, do you wish to do so" , yes will then commit the first record and allow the user to enter the second record, whilst cancel will not allow a second record to be entered.
    If anyone would helpout i would be very grateful.

    Hi
    Here is my suggestion, the idea is to use a global variable to memorize the fact that a record has been created :
    KEY-CREREC
    begin
              if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'FALSE' then
                   create_record;
                   :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
              else
                   message('Commit or delete before inserting a new record');
                   message('Commit or delete before inserting a new record');
              end if;
    end;
    =====================================================================
    KEY-DELREC
    begin
         if :system.record_status in ('NEW','INSERT') then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
         end if;
         delete_record;
    end;
    ====================================================================
    KEY-COMMIT
    begin
         commit_form;
         :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    end;
    ====================================================================
    POST-SELECT
    :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    ====================================================================
    It's a bit more complicated if you allow the user to go beyond the last record for creating a new record, as KEY-CREREC and KEY-DELREC are not triggered.
    In this case, my suggestion is the following :
    KEY-CREREC
    begin
              if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'FALSE' then
                   if :system.last_record = 'TRUE'then
                        next_record;
                   else
                        create_record;
                        :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
                   end if;
              else
                   message('Commit or delete before inserting a new record');
                   message('Commit or delete before inserting a new record');
              end if;
    end;
    ===============================================================
    WHEN-NEW-RECORD-INSTANCE
    begin
         if :system.mode = 'NORMAL' then
              if :system.record_status = 'NEW' and :system.last_record = 'TRUE' then
                   if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'TRUE' then
                        message('Commit or delete before inserting a new record');
                        message('Commit or delete before inserting a new record');
                        delete_record;
                   end if;
              end if;
         end if;
    end;
    ================================================================
    KEY-DELREC
    begin
         if :system.record_status in ('NEW','INSERT') then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
         end if;
         delete_record;
    end;
    =================================================================
    KEY-COMMIT
    begin
         commit_form;
         :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    end;
    ===============================================================
    WHEN-VALIDATE-RECORD
    begin
         if :system.record_status = 'INSERT' and :system.last_record = 'TRUE' then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
         end if;
    end;
    ==================================================================
    POST-SELECT
    :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    ================================================================

  • Raise form_trigger_failure not wokring on validate records

    hi,
    I wrotea block level trigger WHEN-VALIDATE-RECORD, which do some screen level validation and
    in case of failure i use RAISE FORM_TRIGGER_FAILURE. working fine if i move records
    another trigger is KEY-COMMIT on form level.
    which calling a program unit where a command is FIRST_RECORD
    now when i save the records using the save button
    its call FIRST_RECORD, because of this command its executing WHEN-VALIDATE-ITEM
    and execute RAISE FORM-TRIGGER-FAILURE
    but system continue the executaion and jump back to key-commit triiger
    why WHEN-VALIDATE-RECORDS 's raise is not working...
    thanks

    hi
    its call FIRST_RECORD, because of this command its executing WHEN-VALIDATE-ITEM
    another trigger is KEY-COMMIT on form level.
    and execute RAISE FORM-TRIGGER-FAILURE
    If when-validate-item trigger is not set at item-level plz set it at item-level and check.
    set key-commit-trigger at block level.
    may it helps u.
    sarah

  • Form Personalization: How to validate record?

    Hi,
    We need your help. We have developed one custom form which captures data for Inter-Org transfer in Oracle Inventory. User enters Source Organization Code, Destination Organization Code, Item Number and rest of all other information. Source & Destination Organization are in one block of the form and Item number , Quantity etc are in another block on the same form. Item Number field is showing LOV of all list of items from mtl_system_items_b from master Org and that's the requirement of the form.
    Through Form Personalization, User wants while saving the record on the form, it should validate item-Organization assignment for both Source & Destination organization. Item should exist in Source & Destination organization else it should display error message while saving the record.
    Please help me how we can achieve this through Form Personalization.
    Thanks
    Rajesh

    trigger = when-validate-record
    condition =
    not exists (select 1 from mtl_system_items msi, mtl_parameters mp
    where mp.organization_code = :dest_org
    and mp.organization_id = msi.organization_id
    and msi.segment1 = :item_number)
    Action = message
    type = error
    message text = Item not assigned to dest. org.
    Sandeep Gandhi

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

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

Maybe you are looking for

  • The real powerpoint problem

    The reason for this question about powerpoint is that the image quality of the powerpoint became unacceptable once the powerpoint slides were re-created as TIFF files and imported into Final Cut, added to an existing video, then exported as an MPEG-2

  • Check  File Existence and display  alert message

    Hi, I have a servlet which uploads file to server. Below is my code and is working file. Now, I want to check if the file uploading by the user is already exists. If so , I have to display a message to user "The file you are trying to upload already

  • Signature icon in Preview has disappeared

    When I upgraded to Mavericks, the Signature icon disappeared from my edit menu in the Preview app.  How do I get it back please? Todd

  • Processing file

    Hi In case of file-xi-proxy scenario during the processing of file I have a business rek like.................. A trailer and header record should be located in every file, in the event that a trailer or header record is not detected the file should

  • How to request iOS5 Feature?  (ActiveSync Policy)

    I would like to request a feature for iOS5 but do not know how.  What is the process to request a feature? We don't have any Mac's in our organization at this point but do have personally owned iPhone/iPod/iPad users requesting access to our Exchange