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

Similar Messages

  • Issue with When Validate Trigger firing multiple times

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

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

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

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

  • 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

  • Experiencing problems with workflow- validate step

    I am experiencing problems with workflow->validate step in Hyperion FDM.
    I am not able to export unmapped dimension members to Excel.
    Earlier everything worked fine.
    But now all of a sudden it has become a serious problem.
    when I click Export to Excel,processing starts and it's never coming to an end.
    Every thing is getting stuck up.
    Could any one suggest solution to this as it is delaying my deliverable.

    Try opening excel first, then doing the export from FDM.

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

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

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

  • Problem with WHEN-CHECKBOX-CHANGED and ON-POPULATE-DETAILS

    I have a detail block with a relationship set up to a second block. In my first block, if I cause an error but the next action I take is to press a checkbox on another record, my error will display and the raise form trigger failure is triggered but the checkbox changes it's value and the cursor is displayed on the record with the error. I didn't want the checkbox to change if an error occurred. I tracked this through the trace and saw the on-populate-details is fired between the error and the when-checkbox-changed trigger. I went through debug and saw because of the erorr, the system will do a 'return' back to the sending action. I beleive this return is causing the when-checkbox-changed to fire. I'm just guessing here. I tried a similar action on another form without a relationship set up. That would eliminate the on-populate-details trigger. When I did a similar error, I got exactly what I was looking for. I caused the error but pressed the checkbox on another record. The error displayed but the checkbox did not change and the cursor returned to the error record. I need the record to have this relationship. Consequently, I need the on-populate-details trigger. Can anyone think of a solution? I'm currently on Forms 6I. We are going to forms 10G in the next few months. But I really need a solution on my current set up. Thanks.

    The getNextDatabankRecord() call is at the beginning of my run code. I use one step just for this line code.
    Code :
    public void run() throws Exception {
              beginStep("CHARGEMENT DES DONNEES SUIVANTES");
                   info("Chargement des prochaines données...");
                   getDatabank("NouvellesIA").getNextDatabankRecord();
              endStep();
    Stop the user after this step and goto the finish section should not be a problem...
    If I use the "When out of records" option, does it jump directly to the finish section ?
    Thanks,
    Benoit.

  • Big Problem with Instead Of Trigger

    I have following problem: I created my own user-table where I want to store some
    attributes like user-foto etc... This table I join with the HTMLDB
    wwv_flow_fnd_user (I gave myself the select grant on it) in a view
    On the view I created an INSTEAD-OF-Trigger for DELETE-Operations where I delete
    only my user-table. But when I execute it it gives me an
    ORA-01031: insufficient privileges
    I can not understand it.
    <pre>
    ===========================================================
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 27 05:28:13 2005
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> DROP TABLE my_users
    2 ;
    Table dropped.
    SQL> CREATE TABLE my_users AS
    2 SELECT user_id
    3 FROM flows_020000.wwv_flow_fnd_user
    4 ;
    Table created.
    SQL> ALTER TABLE my_users ADD my_attr VARCHAR2(10);
    Table altered.
    SQL> ALTER TABLE my_users ADD CONSTRAINT pk_my_users PRIMARY KEY( user_id );
    Table altered.
    SQL> CREATE OR REPLACE VIEW v_my_users
    2 AS
    3 SELECT u2.user_id,
    4 u.user_name,
    5 u.first_name,
    6 u.last_name,
    7 u2.my_attr
    8 FROM flows_020000.wwv_flow_fnd_user u,
    9 my_users u2
    10 WHERE u2.user_id = u.user_id
    11 ;
    View created.
    SQL> CREATE OR REPLACE TRIGGER trg_del_v_my_users
    2 INSTEAD OF DELETE ON v_my_users
    3 FOR EACH ROW
    4 BEGIN
    5 DELETE my_users
    6 WHERE user_id = :OLD.user_id
    7 ;
    8 END;
    9 /
    Trigger created.
    SQL> DELETE v_my_users WHERE 1=2
    2 ;
    DELETE v_my_users WHERE 1=2
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ===========================================================
    </pre>
    And: If there is no PK on table my_users I got not error!
    Can anybody explain it?
    And: How can I include my listings in the forum with courier font?

    Is the primary key in this table referencing any table(s) in other schema? How should this work?
    Look at the script above:
    ALTER TABLE my_users ADD CONSTRAINT pk_my_users PRIMARY KEY( user_id );
    Bye,
    Rumburak

  • PROBLEM WITH A DATABASE TRIGGER

    WHEN A USER ENTERS A STATUS CODE BETWEEN 70 AND 86 ON THE PAB_SUSP TABLE, THE COMPLETION DATE FIELD ON THE PAB_SUSP TABLE GETS UPDATED WITH THE SYSTEM DATE WHICH IS FINE. THE
    COMPLETION DATE FIELD ON THE EREC_SUSP TABLE FOR THE SAME CORRESPONDING RECORD SHOULD ALSO GET UPDATED WITH THE SAME SYSTEM DATE. SOMETIMES THE COMPLETION DATE FIELD ON THE EREC_SUSP TABLE GETS UPDATED CORRECTLY WITH THE SAME SYSTEM DATE. OTHER TIMES IT DOES NOT. WHAT IS THE PROBLEM?
    I AM ENCLOSING THE CODE IN THE DATABASE TRIGGER. NOTE ALSO THAT THE SUSP_DT FIELD ALSO GETS UPDATED.
    DECLARE
    cursor get_user is SELECT user_id, FROM oracle_user
    WHERE username = USER;
    user_number NUMBER(10,0);
    num_recs NUMBER(10,0);
    num_rec_recs2 NUMBER(10,0);
    seq number(10,0);
    ssn VARCHAR2(9);
    nm VARCHAR2(27);
    dob DATE;
    pg VARCHAR2(2);
    rank VARCHAR2(2);
    act_cd VARCHAR2(3);
    clk NUMBER(10,0);
    recv_dt DATE;
    susp_dt DATE;
    cmpl_dt DATE;
    ocll VARCHAR2(7);
    tagd VARCHAR2(7);
    chg_ind VARCHAR@(1);
    BEGIN
    open get_user;
    fetch get_user into user_number;
    close get_user;
    IF (:new.lcl_pab_susp_stat_cd <> :old.lcl_pab_susp_stat_cd AND
    :new.lcl_pab_susp_stat_cd >= '70' AND
    :new.lcl_pab_susp_stat_cd <= '86') THEN
    cmpl_dt := sysdate;
    END IF;
    IF :new.lcl_susp_dt <> :old.lcl_susp_dt THEN
    chg_ind := 'Y';
    susp_dt := :new.lcl_susp_dt;
    else
    susp_dt := :old.lcl_susp_dt;
    END IF;
    seq := :new.pab_susp_seq;
    ssn := :new.ind_ssn;
    nm := :new.ind_nm;
    dob := :new.ind_dob;
    pg := :new.ind_pg_cd;
    rank := :new.mil_rank_cd;
    act_cd := :new.lcl_act_cd;
    clk := :new.lcl_act_clk_no;
    recv_dt := :new.lcl_recv_dt;
    ocll := :new.ocll_id;
    tagd := :new.tagd_id;
    SELECT COUNT(*) INTO num_recs2
    FROM EREC_SUSP
    WHERE SUSP_SEQ = :old.susp_seq;
    IF num_recs2 > 0 THEN
    UPDATE erec_susp
    SET pab_susp_seq = seq,
    ind_ssn = ssn,
    ind_nm = nm,
    ind_dob = dob,
    ind_pg_cd = pg,
    mil_rank_cd = rank,
    erec_ofc_act_cd = act_cd,
    erec_of_clk_no = clk,
    lcl_cmpl_dt = cmpl_dt,
    lcl_recv_dt = recv_dt,
    lcl_susp_dt = susp_dt,
    ocll_id = ocll,
    tagd_id = tagd,
    lcl_chg_ind = chg_ind,
    rec_tx_dt = SYSDATE,
    rec_tx_user_no = user_number
    where susp_seq = new.susp_seq;
    END IF;
    END;

    S. Wolicki, Oracle wrote:
    No, you cannot!!! NLS_CHARACTERSET is not a session parameter in Oracle.
    Assuming IBM MessageBroker connects through OCI, setting the NLS_LANG variable in its environment to .EE8ISO8859P2 could help. You should also review MessageBroker's documentation, especially any configuration parameters for Oracle, to see if the character set is not configurable there. There is nothing to be done on the Oracle side.
    By the way, can you name any particular characters that do not show up correctly and tell me what you see in place of them?
    -- SergiuszHi Sergiusz,
    I replace back and forth the accented characters, but for large queries, it takes a very long time:
    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(c,'ő','&#x0151'),
    'Ő','&#x0150'),'ű','&#x0171'),'Ű','&#x0170'),'é','&#x00E9'),'É','&#x00C9'),'á','&#x00E1;'),'Á','&#x00C1'),
    'ú','&#x00FA'),'Ú','&#x00DA'),'ö','&#x00F6'),'Ö','&#x00D6'),'ü','&#x00FC'),
    'Ü','&#x00DC'),'ó','&#x00F3'),'Ó','&#x00C3'),'í','&#x00ED'),'Í','&#x00CD');
    (The semicolons let down for display.)I thought that I would change the nls_lang on the client side in a Java node but it is not sure that will work.
    Thank you for your answer.
    Sada
    Edited by: 1002028 on 2013.04.24. 13:48
    Edited by: 1002028 on 2013.04.24. 13:49

Maybe you are looking for

  • Creative Zen 8 gb - no drag and dr

    Hi there, I just received my new Creative Zen and it took only 2 minutes until I almost decided to send it back. I plugged it in with the longest usb cable I've ever seen, opened the explorer - and didn't find the Zen. A window opened that wanted to

  • I wanted to know if i might be eligible to recycle my ipod and get money for it?

    it is an 4g ipod nano and it works pefectly except it has scratches on the back, so i was wondering if there was any possible way i could get money for it?

  • Ocr and mirror ocr files

    hi gurus, what is the difference between ocr actual file and ocr mirror file. as i know ocr mirror is nothing but ocr copy. is there any much difference b/w these files. but while recovering ocr file can we use ocr mirror file.

  • Adobe Premier Elements 10 contents extracted to what file?

    I have downloaded Adobe Premier Elements 10 software which has a reduced set of "Content" available.  I have downloaded the "Content files" to my desktop.  Where to I extract these files in order to make them available within the program?

  • Getting Adobe Premiere movie (on a PC) into iMovie

    I've tried a couple of things, neither of which really worked well. I have about 10 movies I created in Premiere back when I had a PC (yuck!). I'd like to get the movies into iMovie so I can work on them more and take clips from them for other movies