How to invoke when-validate trigger

Hi all ,
I just want to know how can i Invoke when-validate-item trigger of another item by without navigating to that item.
Exampls. I have two items A and B
I want to invoke item B's when-validate-item trigger by keeping the focus on A or being in A .

first: write procedures for each when-validate.
e.g. WVI_name_of_the_item_A and WVI_name_of_the_item_B
then you start this procedure in item A and the other in item B.
now you can use the validation-procedure of B inside the validation of A
try it
Gerd

Similar Messages

  • 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-TRIGGER trigger looping so many times

    Hi,
    Below is the code written in WHEN-VALIDATE-TRIGGER trigger and after raise FORM-TRIGGER_FAILURE
    the process is not stopping and the trigger message looping without end when
    I tab to the next field or try to save the record. I am not sure why the flow did not stop
    after the raise FORM_TRIGGER_FAILURE exception and the trigger looping again and again.
    Please help me to know what is wrong in the code. This trigger written in ITEM level.
    declare
                     msg_type varchar2(3);
                  msg_text varchar2(2000);
                  continue       boolean;
                begin
                  if :pom1_b22.qty < 0 then
                    message_ppkg.get_msg_from_db('RET','04060',msg_type,msg_text);
                    message(msg_text || '.');
                    bell;
                    raise form_trigger_failure;
                  else
                    continue := TRUE;
                    if :pom1_b22.qty is not null and :pom1_b22a.b22_query = 'FALSE' then
                      if nvl(:pom1_b22.irt_created,'N') = 'Y' then
                        if :pom1_b22.qty <> :pom1_b22.save_qty and
                          :pom1_b22.save_qty is not null then                    
                          if check_order_status then
                            continue := TRUE;
                          else
                            continue := FALSE;
                             message_ppkg.get_msg_from_db('RET','04061',msg_type,msg_text);
                             message(msg_text);   
                            bell;
                            :pom1_b22.qty := :pom1_b22.save_qty;
                            raise form_trigger_failure;
                          end if;
                        end if;
                      end if;                
                      if continue then
                        if :pom1_b22.save_qty is null then
                          if :pom1_b22.qty > :pom1_b22a.total_qty then
                             message_ppkg.get_msg_from_db('RET','04057',msg_type,msg_text);
                             message(msg_text || to_char(:pom1_b22a.total_qty) || '.');   
                            bell;
                            raise form_trigger_failure;
                          end if;
                        else
                          if :pom1_b22.qty <> nvl(:pom1_b22.save_qty,0) then
                            if :pom1_b22.qty > :pom1_b22a.total_qty +
                                               (nvl(:pom1_b22.save_qty,0) -
                                                :pom1_b22.qty) then
                                                    message_ppkg.get_msg_from_db('RET','04056',msg_type,msg_text);
                             message(msg_text || to_char(:pom1_b22a.total_qty +
                                              (nvl(:pom1_b22.save_qty,0) -
                                               :pom1_b22.qty)));                 
                              bell;
                              raise form_trigger_failure;
                            end if;
                          end if;
                        end if;
                      end if;
                    end if;
                  end if;
                end;

    Your Raise form_Trigger_failure Condition is not met hence not stopping the rest trigger body.

  • When validate trigger forms 6i

    Please help me to create when validate item trigger.
    There is one table "job" - id, status
    status is X or null. i want to do in forms. when someone is entering value for id, it should check first the status for that id in job table status field.
    if status is null then it should show msg "this id is already open for another job"
    Edited by: only.ashish99 on Dec 26, 2012 1:44 PM

    Hi,
    So You mean that if the user dosent enter the staus then u need to show a message and if the entered status is there in ur table and then u need to show a message.
    Just write in the when validate trigger
    declare
    v_status number;
    begin
    select count(status) into v_status from table;
    If :Block.field_name is null then
    message('');
    Else
    If v_status=0 then
    ur action
    else
    Message('this job is exist for another');
    End if;
    end if;
    End;
    Try this.
    Regards
    Sri

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

  • Problem using when-validate-trigger

    Dear Experts,
    After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
    Please let me know which triiger i should use?
    Thanks
    Abhishek Rustagi

    There is no easy way to do this, however you could create a timer in your when-validate-item trigger which expires immediately, and place all of your navigational code in the when-timer-expired trigger - this way you could check the value which has been entered and navigate accordingly.

  • When validate trigger block level

    Hi,
    I Have a form application. On the entrance page If a user forget to enter his name or Password the form prompt the message to aware him about what is missing.
    SO I wrote the folloing code on when validate trigger block level, but it did not work according to my needs, should I replace this trigger with other?
    Sharbat
    BEGIN
         if:Block1.User is null then
         message('Please enter the user name);
         raise form_trigger_failure;
         if:Block1.password is null then
         message('Please enter the password'););
              raise form_trigger_failure;
              end if;
    end if;
    end;

    use
    if:Block1.User is null then
    message('Please enter the user name);
    raise form_trigger_failure;
    end if;
    on key-next-item of user textbox
    and
    if:Block1.password is null then
    message('Please enter the password'););
    raise form_trigger_failure;
    end if;
    on the key-next-item of the password text box

  • Problem in using when-validate-trigger

    Dear Experts,
    After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
    Please let me know which triiger i should use?
    Thanks
    Abhishek Rustagi

    Hi, the way I use to solve this problem is using both: key-next-item and when-validate-item. In the w-v-i you make the validations you need (this control mouse navigation) and in the k-n-i code write:
    -- first validate the values, to avoid invalid values
    execute_trigger ('when-validate-item');
    -- if trigger fire corectly then you can go to the item you want..
    if my_item = 'A' then
    go_item(my_next_item1);
    elsif my_item = 'B' then
    go_item(my_next_item2);
    end if;
    Ruben.

  • How to use when-validate-item in the form personalization?

    Dear all,
    I want to use when-validate-item trigger in the form personalization on a specific item. while in the same time the when-validate-item is not included in the trigger event list.
    Please advice & Thanks in advance
    Ashraf Ashour

    Use condition. If you are validating a record, just out the desired check in the condition field for that specific item.
    Thanks
    Nagamohan

  • When-validate-trigger

    Hi All
    I want message('please check the order');
    and my code is
    DECLARE
         a VARCHAR2(200);
         b varchar2(200);
    BEGIN
         select s.sale_order_no||sd.prod_id||sd.color,s.PERFORMA_TYPE INTO a,b  from sale_order s,sale_order_detail sd
         where s.id=sd.id and s.sale_order_no||sd.prod_id||sd.color=:gin_detail1.barcode and s.PERFORMA_TYPE!='ORDER CANCEL';
    IF     :gin_detail1.barcode = a THEN
    SELECT SALE_ORDER_NO,prod_id,style,color,xs,s,m,l,xl,pcs INTO :gin_detail1.sale_order_id,:gin_detail1.prod_id,
    :gin_detail1.prod_name,:gin_detail1.color,:gin_detail1.xs,:gin_detail1.s,:gin_detail1.m,:gin_detail1.l,
    :gin_detail1.xl,:gin_detail1.pcs from sale_order_barcode where barcode=:gin_detail1.barcode;
    ELSE
    message('please check the order');
    end if;
    end;when-validate-item trigger raised unhandeled exception ora-01403
    Thanks And Regards
    Vikas Singhal

    Hi,
    Probably your first select statement itself throwing the error - ora-01403
    So may be try to include an exception part for your code, to catch the exception ora-01403 -no data found
    and there display the messgae- 'Please check the Order'.
    Hope it will work then

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

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

  • WHEN - VALIDATE IN ADF.

    hi jdev experts,
    am using jdev 11.1.1.5.0 - adfbc - oracle db10g
    and also i worked in Oracle forms 10g.
    there is some thing like when-validate-item.
    eg: in for oracle forms 10g
    take 2 fields (emp_id,emp_decription) here emp_id as lov.
    in when validate item , i will wrote.
    if emp_id is present return emp_id or else employee not found.
    here my question is:
    in form 10g having when validate. so adf may have like this options.
    so any one route it to that direction.
    hey and one more. and i known about lov,cascading lov,and its dependent bla bla in adf. so i need not know that links.
    again my question simple.
    oracle forms *10g when - validate* equivalent in adf.?
    why am asking i lost that docs and example link and example blogs.. so only asking.
    edit in late: anyone direct me(by blogs,eg,links,videos) how to use when validate in adf good in manner.

    thanks frank.
    i completed project and some many complicated viewlinks with that table.
    so only asking without any viewlink it's possible ah?

Maybe you are looking for

  • Lenovo Flex 2 15 warranty is incorrect

    I bought my laptop on November 11th, 2014. I bought it at Futureshop in Canada. I looked up the warranty status and it has the wrong date on it.  I have called 2 times and they said it would be fixed in 24 hours. Today I check and it is still the inc

  • Dynamical HtmlDatTable - action Listeners still doesn't work

    HI everybody. i create HtmlDatTable with dynamic columns count. I bind methods for every component (commandButton) but all of them doesn't work!!! Please help? it take me a lot of time :-( some pice of my bean: public HtmlDataTable getDynamicDataTabl

  • Improving SNR on Mic recording to built-in sound-card's mic jack

    Hi all, I've been doing my recordings from the built-in mic jack in my laptop (sound card is the basic Intel HDA). From the 'headphones' jack of my Korg, this is not a problem, as the volume level is plenty loud enough for my input volume in alsamixe

  • Use a font that is available in Windows fonts

    Hi all, I am creating a PDF document using the iText library and since I am writing plain text I want to use "Courier New" font. I use FontFactory.getFont(FontFactory.COURIER, 10);When calling getFont("Courier New") it is not available. I work on Win

  • Restore Windows 7 operating system on a new hard drive in HP Mini 210 1095NR

    I have a HP Mini 210 1095NR that had its hard drive crash and is not recoverable.  I have purchased a Seagate 320 gig hard drive to replace the original (160 gb I think) and I have ordered HP recovery disks.  They came as a set of two disks.  I used