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?

Similar Messages

  • When-validate-item trigger restriction on open form or call form

    W have when-validate-item trigger. I need to place a code here that will bring up a form when the "valid entry" on the item has been made. I am getting a frm-40737:Illegal restricted procedure COMMIT...
    Code snippet on the procedure that I am calling from the when-validate-item:
    IF :System.Form_Status = 'CHANGED' THEN
    Commit_Form;
    end if;
    Call_Form ('MY_FORM', HIDE, NO_REPLACE, NO_QUERY_ONLY,'PARAM');
    Is there a work-around. We also cannot use timers here.
    Any help is appreciated?
    TIA

    Thanks Sudha, I tested and it worked with the key-next-item trigger.
    The only thing though, I was told that the users will not use the enter key when they navigate out of the field, it is either clicking on an exit button or function key F4...so I am still stuck with the same problem.
    This site is really helpful and I hope to receive more ideas.
    Thanks!

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

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

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

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

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

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

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

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

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

  • ORA-01403: no data found ---- FRM-40735: WHEN-VALIDATE-ITEM trigger raised

    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    Code Written on find button as below
    BEGIN
              --XX customized
              if (:ADJ_IP_CTRL.DUE_DT_FROM is null OR :ADJ_IP_CTRL.DUE_DT_TO is null) then
              fnd_message.set_string('Due Date from and Due Date To Must be entered.');
              fnd_message.Show;
              raise form_trigger_failure;
              end if;
         BEGIN     
              go_block('ADJ_INV_PAY');
    clear_block(no_validate);
         for inv_rec in (
                             SELECT v.invoice_num,
              v.invoice_id,
              v.invoice_type,
              v.pay_alone,
              v.exclusive_payment_flag,
              v.payment_num,
              v.amount_remaining,
              --TO_CHAR (v.amount_remaining,fnd_currency.get_format_mask(v.currency_code, 42)) char_amount_remaining,
              TO_CHAR (v.amount_remaining,'FM999G999G999G999G999G999G999G999G990D00') char_amount_remaining,
              ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code)
              discount_available,
              /*TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),
              fnd_currency.get_format_mask (v.currency_code, 42))*/
              TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),'FM999G999G999G999G999G999G999G999G990D00')
              char_discount_available,
              ap_payment_schedules_pkg.get_discount_date (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date)
              disc_date,
              v.always_take_disc_flag,
              v.discount_amount_available,
              v.discount_date,
              v.second_discount_date,
              v.second_disc_amt_available,
              v.third_discount_date,
              v.third_disc_amt_available,
              v.gross_amount,
              v.description,
              v.accts_pay_code_combi_id,
              v.due_date,
              v.REMIT_TO_SUPPLIER_NAME,
              v.REMIT_TO_SUPPLIER_ID,
              v.REMIT_TO_SUPPLIER_SITE,
              v.REMIT_TO_SUPPLIER_SITE_ID,
              v.RELATIONSHIP_ID,
              v.external_bank_account_id,
              ieba.bank_account_num external_bank_account_num,
              ieba.bank_account_name external_bank_account_name
              FROM ap_invoices_ready_to_pay_v v, iby_ext_bank_accounts ieba
              WHERE v.party_id = :pay_sum_folder.party_id /* and v.invoice_num like :adj_inv_pay.invoice_num||'%' */
              AND ( (:pay_sum_folder.payment_type_flag =
              'M')
              OR (:pay_sum_folder.payment_type_flag =
              'R'
              AND v.invoice_type IN
              ('CREDIT',
              'STANDARD',
              'DEBIT',
              'EXPENSE REPORT',
              'MIXED',
              'AWT'))
              OR /*Bug5948003, Bug6069211*/
              (:pay_sum_folder.payment_type_flag =
              'Q'
              /*AND (v.vendor_site_id =
              :pay_sum_folder.vendor_site_id
              OR v.invoice_type =
              'PAYMENT REQUEST')*/
              AND ( (:SYSTEM.LAST_RECORD =
              'TRUE'
              AND :SYSTEM.cursor_record =
              '1')
              OR (NVL (
              v.exclusive_payment_flag,
              'N') =
              'N'
              AND NVL (
              :parameter.pay_alone,
              'N') =
              'N'))))
              AND v.currency_code = :pay_sum_folder.currency_code
              AND v.payment_method_code = :pay_sum_folder.payment_method_code
              AND NVL (v.payment_function, 'PAYABLES_DISB') =
              NVL (:pay_sum_folder.payment_function, 'PAYABLES_DISB')
              AND v.set_of_books_id = :pay_sum_folder.set_of_books_id
              AND NVL (v.future_dated_payment_ccid, -1) =
              DECODE (:parameter.manual_fdp_site_acct_src_flag,
              'Y', NVL (:parameter.site_fdp_account_ccid, -1),
              NVL (v.future_dated_payment_ccid, -1))
              AND v.external_bank_account_id = ieba.ext_bank_account_id(+)
              AND v.due_date BETWEEN :ADJ_IP_CTRL.DUE_DT_FROM and :ADJ_IP_CTRL.DUE_DT_TO
                                  ORDER BY v.due_date, UPPER (invoice_num)          
                        --added 08apr2012 (end)
              removed 08apr2012 ORDER BY UPPER (invoice_num)
              ) loop
                   :ADJ_INV_PAY.INVOICE_NUM := inv_rec.INVOICE_NUM;
    :ADJ_INV_PAY.INVOICE_ID := inv_rec.INVOICE_ID;
    :ADJ_INV_PAY.INVOICE_TYPE := inv_rec.INVOICE_TYPE;
    :ADJ_INV_PAY.EXCLUSIVE_PAYMENT_FLAG := inv_rec.EXCLUSIVE_PAYMENT_FLAG;
    :ADJ_INV_PAY.PAYMENT_NUM := inv_rec.PAYMENT_NUM;
    :ADJ_INV_PAY.AMOUNT_REMAINING := inv_rec.AMOUNT_REMAINING;
    :ADJ_INV_PAY.DISCOUNT_AVAILABLE:= inv_rec.DISCOUNT_AVAILABLE;
    :ADJ_INV_PAY.DISC_DATE := inv_rec.DISC_DATE;
    :ADJ_INV_PAY.ALWAYS_TAKE_DISC_FLAG := inv_rec.ALWAYS_TAKE_DISC_FLAG;
    :ADJ_INV_PAY.DISCOUNT_AMOUNT_AVAILABLE := inv_rec.DISCOUNT_AMOUNT_AVAILABLE;
    :ADJ_INV_PAY.SECOND_DISCOUNT_DATE := inv_rec.SECOND_DISCOUNT_DATE;
    :ADJ_INV_PAY.SECOND_DISC_AMT_AVAILABLE:= inv_rec.SECOND_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.THIRD_DISCOUNT_DATE:= inv_rec.THIRD_DISCOUNT_DATE;
    :ADJ_INV_PAY.THIRD_DISC_AMT_AVAILABLE := inv_rec.THIRD_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.GROSS_AMOUNT := inv_rec.GROSS_AMOUNT;
    :ADJ_INV_PAY.ACCTS_PAY_CODE_COMBINATION_ID := inv_rec.ACCTS_PAY_CODE_COMBI_ID;
    :ADJ_INV_PAY.DUE_DATE := inv_rec.DUE_DATE;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_NAME := inv_rec.REMIT_TO_SUPPLIER_NAME;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_ID := inv_rec.REMIT_TO_SUPPLIER_ID;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_SITE := inv_rec.REMIT_TO_SUPPLIER_SITE;
    :ADJ_INV_PAY.REMIT_TO_SUPP_SITE_ID := inv_rec.REMIT_TO_SUPPLIER_SITE_ID;
    :ADJ_INV_PAY.APS_EXTERNAL_BANK_ACCOUNT_ID := inv_rec.EXTERNAL_BANK_ACCOUNT_ID;               
    --               go_item ('ADJ_INV_PAY.INVOICE_NUM');
    --               EXECUTE_TRIGGER('WHEN-VALIDATE-ITEM');
              validate(record_scope);
              if form_success then
              next_record;
              end if;
              end loop;
              first_record;
         exception
                   when others then
                   raise form_trigger_failure;
              END;
    synchronize;
    END;
    Thanks
    -Krishn

    Hello Krishn,
    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    user12266683 wrote:
    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    ORA-01403: no data found clearly indicate that you have SQL Select statement in WHEN-VALIDATE-ITEM trigger and does not handled EXCEPTION
    add exception in your select statement.
    Hope it's clear..
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.*

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

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

  • JDeveloper 11.1.1.3 has Bug "adrci.exe" when I Run ADF Applications

    Hi all
    my Environment is
    1- Windows XP Service pack 3
    2- Database 10g r10.2.0.4.0
    2- Jdev 11.1.1.3
    when I Run any ADF Applications, I got this error "adrci.exe"
    any solution for this error or this bugs from JDev 11.1.1.3?
    mugmug

    Hi Shay ;
    I did not get this error "adrci.exe" inside the WLS log file and
    when I Run ADF Application for the first time only I get this error "adrci.exe" in popup window;
    like the figure in this link:
    http://adfbugs.blogspot.com/2009/11/issues-after-migrating-our-application.html
    but when I run it again (next time) I do not get the error (only for first time)
    thanks

  • WHEN VALIDATE ITEM PROPERTY

    I want to capture the value entered in the enter query mode in a parameter. I'm using the when validate item for the sake, but the trigger is not firing, even though I have the fire in enter query mode property set to Yes.
    Any fix for this or workaround..

    Do this in the pre-query trigger of the block, e.g.
    begin
      :control_block.save_item := :query_block.query_item;
    end;     

  • WHEN-VALIDATE-ITEM Restrictions???

    How we overcome the restriction next-item,go-item
    under WHEN-VALIDATE-ITEM?
    My requirement is once something entered into text box
    it should validate with the database for correctness and then
    if info is correct then it should move to
    next item else it should remain in the same item
    by populating some error message or info message.

    Faheem,
    What you desire should be normal operation. If some data is entered into the field then the return or tab key is pressed, The when-validate-item trigger is fired to do the validation, then the key-next-item is fired, which you hopefully have configured to move on to the next item (it will do this by default unless you have a key-others to overide it)
    If this is not happening, you need to look at you triggers and figure out why not.
    rgds

  • When validate item

    Hi all
    Operating system is win-xp
    oracle databse and developrt suite is 9i
    i write this code in when validate item but when i enter the data in client form and not enetring the showroom address
    just only enter the delevery and invoice address it will show only delevery address or if i enter only showroom address it will not showing any address please help me
    given below is code of when validate item
    BEGIN
         SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
         customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
         customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
         customer_detail.EMAIL_ID
         INTO :sale_order.delivery_address
         FROM customer_detail
         WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='DELIVERY ADDRESS';
    SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
         customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
         customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
         customer_detail.EMAIL_ID
         INTO :sale_order.showroom_address
         FROM customer_detail
         WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='SHOWROOM ADDRESS';
    SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
         customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
         customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
         customer_detail.EMAIL_ID
         INTO :sale_order.INVOICE_ADDRESS
         FROM customer_detail
         WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='INVOICE ADDRESS';
    END;
    Thanks and Regards
    vikas Singhal

    BEGIN
    SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
    customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
    customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
    customer_detail.EMAIL_ID
    INTO :sale_order.delivery_address
    FROM customer_detail
    WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='DELIVERY ADDRESS';
    Exception
    When_no_data_found then
    message('NO DATA');
    raise form trigger failure;
    When TOO_MANY_ROWS then
    message('TOO MANY ROWS');
    raise form trigger failure;
    end;
    Begin
    SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
    customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
    customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
    customer_detail.EMAIL_ID
    INTO :sale_order.showroom_address
    FROM customer_detail
    WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='SHOWROOM ADDRESS';
    exception
    When_no_data_found then
    message('NO DATA');
    raise form trigger failure;
    When TOO_MANY_ROWS then
    message('TOO MANY ROWS');
    raise form trigger failure;
    end;
    begin
    SELECT customer_detail.contact_name||chr(10)||customer_detail.delivery_address||chr(10)||
    customer_detail.city||' - '||customer_detail.PIN_CODE||CHR(10)||customer_detail.COUNTRY||chr(10)||
    customer_detail.mobile_no||' , '||customer_detail.OFF_CONTACT_NO||chr(10)||
    customer_detail.EMAIL_ID
    INTO :sale_order.INVOICE_ADDRESS
    FROM customer_detail
    WHERE cust_id = :sale_order.cust_id and customer_detail.address_type='INVOICE ADDRESS';
    exception
    When_no_data_found then
    message('NO DATA');
    raise form trigger failure;
    When TOO_MANY_ROWS then
    message('TOO MANY ROWS');
    raise form trigger failure;
    END;

  • When-Validate-item question

    Dear all,
    I have a block have 3 database items (seq_no, sname, svalue). seq_no and sname are text item and svalue is a list item.
    Number of records display for this block is 3.
    In when-validate-item of sname, I wrote a validation if sname = 'xxx' then svalue will be 'yyy'.
    The problem now I am facing is, when I changed the svalue to 'aaa' and then click the text item in another block, the validation in sname is triggered and I cannot change the value of svalue.
    Per my knowledge, the when-validate-item will be fired only when the value was changed.
    Therefore, I don't know why it was happened...
    I am using Oracle forms 10g.
    Please help. Thanks for advance.
    Regards.

    Indeed..
    Steve's suggestion about block level trigger is the right approach for this case. So I don't have to put code in many items.
    Splazm also had this nice idea about PRE-TEXT-ITEM.. It saves me from copying NULL to the item. Plus I don't have to worry about reseting the record's status cause user doesn't have the chance to set a value to the item cause he won't be able to navigate into it in the first place.
    Plus GO_ITEM is not needed cause if item is question is NULL that means that user is coming from this item and failure of trigger will just keep the focus there!
    So I combined all and came only with the following lines in PRE-TEXT-ITEM that fits perfectly for my requirement (ADEIA_ID is the item in question):
    IF NOT :SYSTEM.TRIGGER_ITEM = 'ADEIA_DETAILS.ADEIA_ID' AND :ADEIA_DETAILS.ADEIA_ID IS NULL THEN
    error message
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    Thanks all you've been of great help for this!

  • When-validate-item firing on block level.

    Hi all
    i have six fields and when-validate-item trigger is working on block level, i want to display records in one field,i want when-validate-item trigger work on item level not on block level,any help will be greatly appreciated.
    here is the code.
    When-Validate-Item Trigger.
    declare
         Str_Space VARCHAR2(20);
    begin
    Str_Space := ' ';
    :ins1.ref := :ins1.branch || Str_Space || :ins1.class || Str_Space || :ins1.year || Str_Space || :ins1.serial || Str_Space || :ins1.cno || Str_Space || :ins1.edno;
    end;
    sarah

    Francois Degrelle.
    just look the following code.
    DECLARE
         Str_Space VARCHAR2(20);
    begin
         Str_Space := ' ';
    :ins1.ref := :ins1.branch || Str_Space || :ins1.class || Str_Space || :ins1.year || Str_Space || :ins1.serial || Str_Space || :ins1.cno || Str_Space || :ins1.edno;
    END;
    by using the above code i am passing branch,class,year,serial,cno and edno to Ref column( 1 G01 2009 13112 00 01). and Str_space variable is creating space for each item.i want the above code work at item leavel instead of block level.Is it poassibl?
    sarah

  • Workarounds for clear_form in when-validate-item  trigger

    Hi,
    I'm using forms6i
    I want to call clear_form in when-validate-item trigger.
    Since they are restricted procedures, i cant do that.
    So what are the workarounds available?
    There are items which are in control block and also records of a datablock available in the form,
    I want to clear everything(control block items and datablock items)
    Thanks

    Divya wrote:
    Hi,
    I'm using forms6i
    I want to call clear_form in when-validate-item trigger.
    Since they are restricted procedures, i cant do that.
    So what are the workarounds available?
    There are items which are in control block and also records of a datablock available in the form,
    I want to clear everything(control block items and datablock items)
    ThanksYou want the clear the form when you fire when-validate-item trigger
    inside the when-validate-item trigger after you commit
    COMMIT_FORM;
    if form_success then
    GO_ITEM(-------);
    clear_form(no_validate,full_rollback); EXECUTE_TRIGGER('WHEN-NEW-FORM-INSTANCE');

Maybe you are looking for