When validate record problem

Dear friends,

I try to apply the following code when validating record trigger


If *: not in budgcode (select g_budgcode in the cat_acct.g_budg where g_budg_acccode =: t_vou_acc_code) * then
alert_id: = find_alert ('MESSAGE_ALERT');
set_alert_property (alert_id, alert_message_text, 'Incorrect Budget Code..');
alert_btn: = show_alert (alert_id);
raise form_trigger_failure;
end if;


during compilation, it throws the following error

subquery not allowed in this context

Thus, any work around?

waiting for answer


Manish Manyal

Yes:

select count(1)
into l_count
from cat_acct.g_budg
where g_budg_acccode=:t_vou_acc_code
and g_bugcode = :budgcode;

if l_count = 0 then
 ...

Tags: Oracle Development

Similar Questions

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

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

  • When-validate-point shot F10?

    In Forms6i, there is a block with data element two, itemA and itemB. I have a when-validate-Item trigger on itemA:

    If: itemA = 0 and: itemB > 0 then
    raise form_trigger_failure;
    end if;

    If I enter 0 itemA and itemB (current position of the slider on itemB) 5 and press F10, Oracle stores data. I don't want to save data if no trigger of W-V-I is not correct.

    -J' have set unit (property) of Validation at the point
    -KEY to ENGAGE on the level of form is:
    BEGIN
    Enter;
    IF this is Form_Success THEN
    RAISE Form_Trigger_Failure;
    END IF;
    IF: System.Form_Status = "MODIFIED" THEN
    Commit_Form;
    IF: System.Form_Status <>"QUERY" THEN
    Message ('error!');
    Bell;
    RAISE Form_Trigger_Failure;
    END IF;
    END IF;
    END;

    Can someone tell me what is the problem? Why forms commit data if one of the W-V-I is not ok?

    Have you done these steps?

    Enter 0 in itemA. -> WVI - lights and does not raise no exception for itemB is null
    Enter itemB 5. -> No WVI-trigger on this point, so no need for validation.
    Now your file is valid, that there will be no more validation, so the form will record data.

    You must either add an additional trigger WVI to the itemB, or create a WHEN-VALIDATE-RECORD-trigger block to do the validation.

  • When-validate-folder delete_record

    Hi all

    I have a problem in my form in this scenario.
    I have to delete a new record if the user isn't on the ground the line in question. Then firstly any when-new-folder-instance, I put sysdate in begin_date field. so when the user dosnt the folder field I would like to remove it but I don't see how. Because when I have the fire when-validate-folder I can't do delete_record.

    I don't know if anyone has a solution.

    A TIMES-NEWS-RECORD-INSTANCE
    IF: BLOCK1. BEGIN_DATE is null THEN
    : BLOCK1. DATE_DEBU_INTE: = trunc (sysdate);
    END IF;

    WHEN-VALIDATE-RECORD
    -I want to delete the line.


    Thanks in advance.

    If you use the value 'default' - property of the field you want to assign SYSDATE to and the default value $$DBDATE$ $, so you will not need to do anything. If the user leaves the record again, it will be 'removed '.

  • 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

  • problem when-validate-point and when-timer-expired...

    Hello
    In the when-validate-agenda of an item, there is the piece of code:
    Start
    h: = create_timer ('mon_timer', 1, no_repeat);
    end;

    and in the when-timer-expired in the block of the form:

    Start
    ....
    set_block_property ('Blockname', default_where, 'id =' |:cust.id);
    go_block ('cxs');
    do_key ('execute_query');
    ....
    end;

    The code above in when-timer-expired is not executed... I mean the go_block and run the query {at least I do not see the query results in the cxs block}...!
    But if I change the piece of code...

    set_block_property ('Blockname', default_where, 'id =' |:cust.id);
    x: = show_alert (...);
    go_block ('cxs');
    do_key ('execute_query');

    then the piece of code in WTE is carried out as planned...

    What may be the cause...?

    I use forms 6i with patch 12 and db 10 g v.2
    Thank you
    SIM

    Hmm. Maybe try a SYNCHRONIZE after the GO_BLOCK.

  • commit to working when-validate-point around pls

    Dear friends,

    I have the same problem. Pls give me some inputs to achieve this result.

    There is a block record multi in my form. When user tries to enter duplicate data in this block and tab from the last field i.e. end_date then a pop up should be raised.

    "It's duplicate, you want to keep it? It has 2 buttons, yes or no.

    When the user clicks "Yes" key data must be registered immediately (committed).

    As I put this validation in when-validate-item of this class end_date I can't use commit-shape; Is we work all around to achieve this? Pls suggest some ideas.

    Kind regards

    REDA

    Hello

    I suggest you use the exit timer trigger, it will solve your problem, set the timer in the when-validate-agenda 1 microsecond and after you press the tab key, this will start the timer-out trigger and you can put your commitment within this trigger.

  • Dilemma when-validate-Item and Go_Block/Execute Query

    Hey people out there - probably not a matter of surprise on this forum. I have tried to look for it and came up with a few posts but did not find solutions. If all goes well, I also did the right way to conduct a search on this forum. If this is a message for the umpteenth time on this question, I apologize.

    So, I have 2 blocks:
    1. the block command that contains the field STUDENT_ID (database item = 'n')
    2 block database which contains STUDENT_ID field (element of database = 'Y' and many other areas)

    My goal is to do an Execute_Query if the user enters the student card, then press TAB or place the MOUSE in the database block and display the record if it exists. As we know, a Go_Block is not allowed in When-validate-Item. So, I went a little more away from "simulate" this. The problem is that I'm always pulled the query Execute when the record has already been retrieved. Here's what I have so far. Thus, the trigger next-item key works fine if the user types a tab of the student card and presses. It also works very well if the user clicks on the STUDENT_BK as the trigger once - new - block - Instance that triggers calls the next key. The problem occurs when after recording was recovered and the user click on control.student_id then comes and clicks on the STUDENT_BK, the KEY NEXT-ITEM trigger fires again.

    Suggestions or pointers would be more than welcome.

    Thank you!

    CONTROL.student_id. Next-key
      if :control.student_id is not null and :SYSTEM.BLOCK_STATUS != 'CHANGED' then
        next_block;
        clear_block(NO_COMMIT);
        execute_query;
      else
        show_alert('Please enter Student ID');
      end if;
    STUDENT_BK. Once - new - block - Forum
    go_item('control.student_id');
    do_key('next_item');

    I think you remove the "value copy of the element" and add a where clause clause to your STUDENT_BK of "student_id =: CONTROL.» STUDENT_ID.

    Then when you do

    if STUDENT_BK.STUDENT_ID != :CONTROL.STUDENT_ID then
    

    It logic should endeavour to answer your second question mark block requirement when the user between the block of database STUDENT_BK. If the IDS match, the record already was questioned, if this is not the logic of your application is triggered and with the where clause added to your STUDENT_BK block, it would be in the folder that you want to.

  • Filling of the elements in another block in when-validate-item

    When the user changes the value in the given field, I need to insert records into different blocks. The second block is block of multi-record. The two blocks are no db block, just for display. When the value is changed by the user to the first block, calculating product collecton who wish to view the content of each element in the second record to display block. The problem is that I can not enter the values for records in the second block other than the first record. To access the second records block display, need to navigate to display block with go_block and navigate to new records with next_record. Both go_block and next_record cannot be called from the Organization in the form of small modules.

    I want to avoid having to press the button that makes a new calculation and redisplay (so can use go_block and next_record), wish just to refresh when the user updates the value, IE the Organization

    You can use WHEN-VALIDATE-ITEM trigger to loop through the record of the block in detail using the TIMER. What you have to do is in the trigger WHEN-VALIDATE-ITEM create timer like below...

    TRIGGER = WHEN-VALIDATE-ITEM
    DECLARE
      vTimer TIMER;
    BEGIN
      vTimer:=CREATE_TIMER('MY_TIMER',10,NO_REPEAT);
    END;
    

    Now, create a trigger more on called WHEN-TIMER-EXPIRED at the form level and use the code below...

    TRIGGER = WHEN-TIMER-EXPIRED
    BEGIN
      GO_BLOCK('DETAIL_BLOCK');
      FIRST_RECORD;
      LOOP
       -- Perform your functionality here...
       IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
         EXIT;
       END IF;
       NEXT_RECORD;
      END LOOP;
    END;
    

    -Clément

  • Digital recorder problems Toshiba HDR5010KB

    Ive been happy with my digital recorder HDR5010KB so far.

    Some problems occurred:

    (1) on the playback of recordings, the image seems to freeze image and then jump to catch up with the audio.

    (2) the recorder fails to record programs when the recorder is in standby mode. (program than a single clock set - if theres no program conflicts etc.).

    Ive reformat the drive, updated the software (from download Toshiba) and I did a reset of box of manufacturing and the problems are still there.

    Any ideas on how to fix cela - or will it be a case of back to Toshiba warranty?

    Thank you very much!

    Hey dude

    It comes to portable systems from Toshiba, the options and the accessories forum.
    I don t think that someone might be able to help here in this community.

    I recommend you to contact your dealer for recommendation... maybe guarantee would cover this issue...

  • Camileo H10 - what is fps when I record 1280 x 720?

    Hi all

    can you please tell me someone what is fps (frames per second) when I record 1280 x 720 on this unit.
    All the docs and newspaper broadsheet says it's 30 frames per second. But when I opening recorded video in the player VLC it said 20 fps.

    And the properties of files windows too. Where is the truth? Or the problem?
    Thanks for the reply

    Hello

    I tested it with different settings. The same result here.
    Sorry, but I don't know what to say on this subject.

  • Vista, crackle on sound when I record webcam reading

    I have Dell Inspiron 1720 in windows vista, when I record using the integrated or eternal webcam then when reading there is a Crackle of sound that did not exist on previous records. I reinstalled codec sigmatel audui of high definition that made no difference. Please can someone help. Thank you.

    Hi FrankCampbell


    You can check the links below and check out them if the steps to help you resolve the issue-

    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-I-stop-my-music-from-skipping-or-breaking-up-when-I-play-it

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-fixing-common-sound-problems

     

    I hope this helps.

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

  • 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

Maybe you are looking for