When-validate-trigger

Hi all


I want to 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 triggered unhandeled exception ora-01403

Thanks and greetings
Vikas Singhal

Hello

Probably your first select statement is throwing the error: ora-01403
So maybe try to include part of the exception for your code to intercept the exception ora-01403 - no data available
and it displays the messgae - "Please check the order.

Hope it will work then

Tags: Oracle Development

Similar Questions

  • How to disable the current point when validate trigger

    Hi all
    I want to disable the current text point when validate trigger.

    Generally, we rely on WHEN-VALIDATE when the cursor leaves a field. In this case, because the cursor leaves the ground, why are you trying to turn it off at this point? The other time would be during the validation process. In this case, you should be able to disable during the WE-COMMIT or in a VALIDATION KEY.

    I guess if we understood better what you want to accomplish and why you want to do, we could offer something more useful.

  • Problem with when-validate-trigger

    Hi all

    I work with form of oracle 10g,

    I developed a Form with two blocks: block Query_find and Guarantee_block (this is my main block). And query to find block has 5 fields. For example Po_number, Guarantee_number and Guarantee_type etc.

    Thus, in the query is block I have a button called NEW, FIND, when we enter Po_number and click SEARCH, then he gets the details of this po number and moved to Guarantee_block with all the details of the guarantee_block.

    So when the user click on the button again travels to the block of the warranty and the user needs to enter new data and save. SO I wrote some simple validations like that for any field. When the user enter a value guarantee no field and he tries to move it will lift a msg. Or well, if he tries to enter the existing guarantee number, it will get a message. Its works fine.

    But my problem is when the user to enter the po_number to block Query_find and click Find button it throws this message ("security number already exist"). I don't know how its happens I wrote this procedure inside a pkg and called only in the when validate article in this topic only. Can any pls tell me what is wrong with this code, and why this trigger activated automatically when we click on the button search.

    PROCEDURE C_GUARANTEE_NO (event VARCHAR2)
    IS
    number of lv_count;
    BEGIN
    IF (event = "WHEN-VALIDATE-ITEM")
    THEN
    IF: BANK_GUARANTEE_BLK. C_GUARANTEE_NO IS NULL
    THEN
    fnd_message.set_string ('enter security number');
    fnd_message. Show;
    RAISE form_trigger_failure;
    On the other
    Select count (1) in the lv_count of xxbgs_bank_guarantee_master
    where c_guarantee_number =: BANK_GUARANTEE_BLK. C_GUARANTEE_NO;
    If lv_count > 0 then
    fnd_message.set_string ("guaranteed this number already Exist");
    fnd_message. Show();
    RAISE form_trigger_failure;
    END IF;
    END IF;
    END C_GUARANTEE_NO;


    Concerning
    Srikkanth

    Hello
    Your design is very complex to me.
    Your design says, insert you data in to your BANK_GUARANTEE_BLK, so the validation trigger is activated.
    You can do another way using the lov.

    Hoping to understand...

    Published by: HamidHelal on January 25, 2012 22:44

  • When validate trigger forms 6i

    Please help me to create when validating the trigger.

    There is a "job" - id, status table

    the status is X or null. I want to do in the forms. When someone is entering the value for the id, he should first check the status of this id in the status field of work table.

    If the status is null then it should show msg "this id is already open for another job.

    Published by: only.ashish99 on 26 December 2012 13:44

    Dear Mr id is not check state. I make a few changes.

    declare
    number of v_status;
    Start
    Select count (status) in the table v_status
    Where id =:Block.ID;

    If: Block.field_name is null then
    message (»);
    On the other
    If v_status = 0 then
    your action
    on the other
    Message ("this is work is for another");
    -If you want to stop then.
    raise form_trigger_failure;
    End if;
    end if;
    End;

    Published by: Sachingmrt on 26 December 2012 16:10

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

    Hello
    I'm looking for a code in the trigger once - vaidate - record in the BLOCK level.
    The trigger should fire only if a value of item checkbox is checked (value ='Y) for the current record (that is to say, if already existing other records have a checked value (='Y), it is not serious and the trigger should not fire)
    Please help me to achieve this goal:
    The code I tried once - vaidate - Trigger, who does not work as I want to:
    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 code above does not fire...
    If I remove the part,
    and: SYSTEM. RECORD_STATUS = 'CHANGE '.
    This event fires for "all"(pas seulement les enregistrements modifiés actuellement) files where nvl (: DEFLOC.to_be_defaulted, ' don't) = 'Y' and: DEFLOC.COMMENTS is NULL ".
    Help, please!
    Note: DEFLOC.to_be_defaulted is an element of database : DEFLOC.COMMENTS is a part of database

    Hi blue,

    There is another way,
    In the trigger when-box-changed.
    If: your_chk_box = 'Y' then
    set_Record_property (: changed_Status, system.cursor_Record, 'your_blk', status);
    on the other
    set_Record_property (: system.cursor_Record, 'your_blk', status, Query_Status);
    end if;

    Then, it is easy for you to discover the records modified using get_Record_property ((: system.cursor_Record, 'your_blk', status))

    Hey, I would like to ask you a Question, is that the check_box point is part of database?
    If so,.
    It's easier... the crazy code will work for this

    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;
    

    in the opposite case
    If you are creating this temp. point, it should be in the same block as item no db.
    I will explain this... You set the State of the checkbox to_be_defaulted some requested folder of Y based on certain conditions, right?
    In any case those files are not editable. Now your condition is to find the boxes newly registered.
    In the post request or where you set to_be_defaulted as ' Y, by default, the new element with the value, while in him when validate trigger, you
    know which folder must attack, it's records nvl (a new item, 'n') = ' n and to_be_defaulted = 'Y '...

    Concerning
    Dora...

  • Values to change due When-validate-item trigger

    Hello

    I develop a Form6i. I have a lov client_name field. I have a when-validate-item trigger for the customer name field.
    When I select the cutomer_name I have other fields who shoot according to the client_name as payment_term, Sales_rep, price list and so on.

    The question I have is Ex:

    When I select client_name = "ABCD". Field of payment term will be driven using the code of a trigger when_validate_item and complete payment limit = 45 Net.
    When I change the payment term is Net 30 and save the form, it will return to Net 45 and saves.
    I know it's because when-validate-trigger fire again at the form level.

    I want to change the payment_term to change only when client_name y change. Like the same functionality as Oracle, order entry

    How do I have more to come, can someone help please.

    Thank you.

    In "KEY-COMMIT" trigger

  • Personilization (11.5.10): Can I use a WHEN-VALIDATE-ITEM trigger

    I want to use a when validate trigger in forms, but I can't select it in the list. Is it possible to use this trigger or y at - it another way to achieve this functionality. It also seems that the triggers are not triggered on Flexfields (attribute < n >), is it possible to have their fire on flexfields too?

    Published by: Martin van Donselaar on 18-Aug-2008 02:02

    Martin,

    Forms customization features are described in detail in ML notes 279034.1
    and restrictions are described in 420518.1

    Srini

  • Oracle forms when-validate-point trigger

    Forms [32 bit] Version 10.1.2.0.2 (Production)
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production
    With partitioning, OLAP and Oracle Data Mining options
    Release 9.2.0.8.0 - Production jserver
    Oracle Toolkit Version 10.1.2.0.2 (Production)
    PL/SQL Version 10.1.0.4.2 (Production)
    Oracle V10.1.2.0.2 - Production procedure generator
    PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
    Query Oracle 10.1.2.0.2 - Production Designer
    Oracle virtual graphics system Version 10.1.2.0.2 (Production)
    The GUI tools Oracle Utilities Version 10.1.2.0.2 (Production)
    Oracle Multimedia Version 10.1.2.0.2 (Production)
    Oracle tools integration Version 10.1.2.0.2 (Production)
    Common tools Oracle area Version 10.1.2.0.2
    Oracle 10.1.0.4.0 Production CORE


    I have a field called equip_code and some validations on the when-validate-item trigger that fills some years messages then opens a comment box. Next to this piece of code equip, I have a button for the list of values. If the user clicks the button (LOV), I have this code.

    If FORM_SUCCESS then
    do_key ('LIST_VALUES');
    end if;

    How can I force the trigger when-validate-point once the user chooses in a list of values.

    Next key element I have this code

    Validate (item_scope);
    If form_failure then
    raise form_trigger_failure;
    end if;
    do_key ('enter');

    I have this so that when-validate-item trigger before button-next. But when the user chooses in a list of values, I want to trigger when-validate-point. Any help appreciated.

    Your LOV button, in relaxation when button pressed, just do this:

    Go_item('MY_BLOCK.) EQUIP_CODE');
    If Form_Success then
    List_Values;
    End if;

    I don't think that anything on the trigger next-item key you need. If the equip_code value is changed, the WVI trigger runs when the focus (the slider) leaves the field.

    If you want to force the validation immediately once the user selects a value from the LOV, you can then change the List_Values; call over Do_key ('LIST_VALUES'); then create a trigger key-ListVal on the element. In the code, you d code: If Show_LOV ('MY_LOV') then Validate (Item_Scope);

    You must NOT put the code of validation in the trigger element next key, because it does not work if the user uses the mouse to click in a different field, or that he uses any number of other methods to leave the field.

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

    Hi all

    Pending Production, we have a problem on invoice AP Workbench, gives an error (FRM-40735 after query Trigger on level Bill) when we recover the existing data of the invoice is entered.

    For this we have compiled the invalid objects and applied the patch according to 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 someone help us

    Thank you
    SAI

    SAI,

    Thanks for the update and share the solution.

    Hussein

  • Go_Item not available in a when-validate-Item trigger function

    Hello. I find that I can't use the Go_Item function in a trigger when-validate-point because it's a small trigger. Is there a common method to pull a trigger that I can use to validate an element (similar to the trigger when-validate-point) is not restricted to where I can use built-ins such as Go_Item, Go_Block, etc... I would use the trigger next-item key, but it does not when a user mouse clicks outside of the question, I need to validate.

    I need to get a validation on an element that identifies if some values were seized. If I find some values, so I need navigate a block "Diary problems" where the user can complete a problem. After leaving the block "Issues Log" I need then to return to the previous box and allow the user continue to enter items. This navigation appear to be limited in the when-validate-Item trigger.

    Any help would be greatly appreciated.

    Yes as Frane explained to create a timer and the fire on WHEN-VALIDATE-item and it expires after your operation as workaround

    or at the level of the blocks ONCE - NEW - ITEM - INSTANCE, you can write something similar

      if :system.trigger_item = 'MYBLOCK.MYITEM' then
             Your code
     end if;
    

    Baig,
    [My Oracle Blog | http://baigsorcl.blogspot.com/]

  • go_blok procedure 40737:Illegal restricted when-validate-item trigger

    I found a few threads that mention this error, but found no solution. I tried after changes both when-validate-item triggers and 40737 error.
    Location: field w / LOV user selects the name used, when the focus is changed to the next trigger field fires. trigger calls the procedure.
    < pre >
    Get_data PROCEDURE IS
    v_badge_number varchar2 (5);
    v_lname varchar2 (15);
    v_fname varchar2 (15);
    v_mid varchar2 (1);
    v_ssn varchar2 (9);
    date of v_dob;
    v_title varchar2 (50);
    v_shop varchar2 (5);
    v_shift varchar2 (1);
    v_grade varchar2 (10);
    v_age VARCHAR2 (3);
    v_gender varchar2 (1);
    BEGIN
    Start
    Select empno,
    substr (lname, 1, 15) lname,.
    substr (fname, 1, 15) fname,.
    substr (mname, 1, 1) mid_init.
    SSN ssn,
    Date of birth date of birth,
    original title,
    taa_cshop shop,
    Maj taa_cshift,
    pay_plan | » -'|| series | » -'|| class class,
    substr (((to_date (to_char (sysdate, ' dd-mon-yyyy ")) - to_date (to_char (dob, 'Mon-dd-yyyy'))) + 1) / 365), 1, 2) age.
    between the sexes
    in v_badge_number, v_lname, v_fname, v_mid, v_ssn, v_dob, v_title, v_shop, v_shift, v_grade, v_age, v_gender
    of personnel_table
    WHERE name =: name;
    exception
    When no_data_found then: badge_number: = "XXXXX";
    end;
    Start
    GO_BLOCK ('IJT_INJ_PERS_TBL');
    : badge_number: = v_badge_number;
    : last_name: = v_lname;
    : first name: = v_fname;
    : middle_initial: = v_mid;
    : ssan: = v_ssn;
    : date of birth: = v_dob;
    : function: = v_title;
    : Shop: = v_shop;
    : Shift: = v_shift;
    : rank: = v_grade;
    : age: = v_age;
    : sex: = v_gender;
    end;
    end;
    < / pre >
    Thank you all for any help,
    David

    After a second look at your code, it seems that you set just values for the detail-block IJT_INJ_PERS_TBL.

    If you only assign values, there is no need for the GO_BLOCK. Just leave this line.

    BTW... When you refer to blockitems, you must use the BLOCK. POINT as

    :IJT_INJ_PERS_TBL.badge_number       :=  v_badge_number;
    :IJT_INJ_PERS_TBL.last_name          :=  v_lname;
    :IJT_INJ_PERS_TBL.first_name         :=  v_fname;
    :IJT_INJ_PERS_TBL.middle_initial     :=  v_mid;
    :IJT_INJ_PERS_TBL.ssan               :=  v_ssn;
    :IJT_INJ_PERS_TBL.dob                :=  v_dob;
    :IJT_INJ_PERS_TBL.job_title          :=  v_title;
    :IJT_INJ_PERS_TBL.shop               :=  v_shop;
    :IJT_INJ_PERS_TBL.shift              :=  v_shift;
    :IJT_INJ_PERS_TBL.grade              :=  v_grade;
    :IJT_INJ_PERS_TBL.age                :=  v_age;
    :IJT_INJ_PERS_TBL.gender                :=  v_gender; 
    
  • Question about integrated NEXT_RECORD and when-validate-point trigger

    Hello

    I work with a form that/did the following:

    1) has two blocks of data (block 1 - & gt; Simple registration block & Block 2 - & gt; Block Record multi)
    2) has few items in each block.
    (3) when I filled the block 1 fields and press tab to navigate to next item key of an element in the trigger in block 1, block 2, I created a timer and when the period expires, the When-Timer-Expired trigger in the form of fires, which has a cursor that retrieves data from different database tables and assigns to the items in block 2 and saving the form must Save all records to the database tables attached to form blocks.

    During this process when I open the cursor and assign values to each element and say NEXT_RECORD when-validate-point triggers written on each level elements fires and validations. The code looks like this.

    Code of the trigger WHEN-TIMER-EXPIRED

    DECLARE
    CURSOR C1
    IS
    ................
    ................
    ................
    BEGIN
    FOR c1_rec in C1
    LOOP
    : block2.item1: = c1_rec.col1;
    : block2.item2: = c1_rec.col2;
    : block2.item3: = c1_rec.col3;
    message ("point value 3 is" |: block2.item3);

    NEXT_RECORD;
    END LOOP;

    DELETE_RECORD;
    POST;
    PREMIER_ENREGISTREMENT;
    END;


    So my problem is the value assigned to: block.item3 before call NEXT_RECORD is away for WHEN-VALIDATE-ITEM trigger on the same element. I tried to print the value as soon as the trigger is activated. Assume that the previous value is "100" the WVI trigger value is printed with a NULL value.

    I tried several times, but all the time, I get the same value.

    Can someone help me identify the problem?

    Thanks for your time and help

    Your problem may be a timing problem caused by a trigger when-validate-order of the day on your null file at the end change your loop like this:

    FOR c1_rec in C1 LOOP
      If :System.Record_status <> 'NEW' then
        Next_record;  --only advance if record is already populated
      End if;
      :block2.item1 := c1_rec.col1;
      :block2.item2 := c1_rec.col2;
      :block2.item3 := c1_rec.col3;
      message ('Value of item 3 is ' || :block2.item3 ||', Value in Col3='||c1_rec.col3);
      message(' ',no_acknowledge); --force above message to display immediately
    END LOOP;
    POST;
    

    In addition, you must not use next-element key to start a clock. What happens if the user clicks on the element rather than the tab? You should start the timer of the trigger when-validate-record of the first block. It runs all focus time leaves the line of Block_1, unless a change has been made, and regardless of how the user leaves the line.

  • What trigger should I use other than when-validate-point

    should what trigger I use, if I want something to fire when an item is changed?

    I don't want to use when-validate-item, because he shot whenever a record is displayed. I want to launch my code only when an element has changed its value?

    I thought I can use pre-text-point and post-text-point and run my code once the value on the post-text-point is to compare different pre-text-item. But I think it's not elegant.

    I need to store a value in a package.

    Is there a more 'user-friendly' way to do this in the forms?

    Can I check the status of an item? There are block_status, form_status and record_status, but not item_status.

    Thanks to you all.

    There's a trigger after CHANGE
    But it is included in web forms only for the sake of compatibility with older versions.
    If you are using a version older than 9i, maybe so you can use this trigger
    In addition, this trigger fires even when data are extracted from the database using execute_query.
    So, maybe you will need to do the verification:
    If: SYSTEM. MODE = "QUERY" then
    .
    .
    .

    Inserting the data in the tables in documents, and not as columns (items)
    This is why there is a record_status.
    The lock status is used to see if the record has changed for documents in the block.
    And form_status is used to see if there is any block in the form in which the record_status has been changed for the documents in this block.

  • When-validate-item trigger doesn't trigger when press the button

    Hello experts.
    I use a when-validate-item in a text element. It works fine when I have on another element of text cursor, but if I press a button the man commits my form, does not draw the when-validate-point. How can I did it light when I press the save button / commit?

    Thank you
    John

    create the button navigable mouse...

  • WHEN-VALIDATE-ITEM triggers in a one-expected scenario

    Hi all

    I have a recording multiple field followed a checkbox for each record, where I have the trigger of the ORGANIZATION that actually changes the value of the checkbox on 'Y' when the field is changed manually.

    Case 1: (Expected)

    In this case, the existing value in the field is '-', now I replaced the field with the same value of 1, the VMI is triggered and box is enabled ('Y') indicating that this record is changed manually. .

    Case 2:(Un-Expected)

    In this case, the existing value in the field is '-', now I replaced the field with the same value '-', but still the VMI is triggered and check box is selected ('Y') indicating that this record is changed manually.

    Please let me know if this is the real behavior of the ORGANIZATION.

    Vicky,

    It's actually expected behavior.  Forms does not care if the value of previous and current are the same - he only cares that a value has been entered.  If you want the VMI trigger only when the previous value is different from the current value, you will need to encode this check in your trigger of the ORGANIZATION with the help of the trigger of the item once - new - item - Instance (WNII).  Something like the following example:

    The following code examples assume that you have created the parameter of type CHAR PREV_VALUE object:

    -- Sample When-New-Item-Instance trigger.
    -- This trigger is needed to capture the value of the item before the user changes it.
    BEGIN
         :PARAMETER.PREV_VALUE := NAME_IN('SYSTEM.TRIGGER_ITEM');
    END;
    
    -- Sample When-Validate-Item
    BEGIN
         IF ( :PARAMETER.PREV_VALUE != :YOUR_BLOCK.YOUR_ITEM ) THEN
              -- The Previous Value is not the Same as the Current Value. User has changed the value.
              -- Do whatever validations need to occur here.
              ....
         ELSE
              -- Previous Value is the SAME as the Current Value
              -- Suggesting that the user typed in the same value in the field.
              -- Forms sees this as a change; which is why the WVI trigger is firing...
              NULL;
              -- NOTE: I would not normally code an ELSE where the instruction is NULL.
              -- I would just end the if statement (END IF;)
         END IF;
    END;
    

    Craig...

Maybe you are looking for