Raise FORM_TRIGGER_FAILURE don't work well.

Dear All,
I'm facing a problem that I can't understand well.
I have a screen that contain two fields: Field1 and Field2.
The control I had to add: is to avoid saving duplicate records, and also do not save a record if one of these fields is empty.
I wrote the trigger KEY_COMMIT, where I did:
Line: -----
declare
     x number;
     ret number;
begin
if ( (:Field1 is null ) and (:Field2 is null ) ) then
     ret:=msgbox('Please choos a Field1 and Field2');
               RAISE FORM_TRIGGER_FAILURE;      
else if ( (:Field1 is null ) or (:Field2 is null ) ) then
     ret:=msgbox('Please Enter Field1 and Field2');
               RAISE FORM_TRIGGER_FAILURE;
               else
                    begin
                    select count(*) into x from TABLE1 where xxxxxxxx=:Field1;
                    exception when others then
                         x:=0;
                    end;
                    if x>0 then
                         ret:=msgbox('Field1 Already Registred');
                         :Field2:='';
                                             RAISE FORM_TRIGGER_FAILURE;
                    else
                         commit;
                    end if;
end if;
end if;
end;
Line: -----
The problem in that is when I click on EXIT button, I get this message: " Do you want to save all modifications you made? "
If I click YES => I find in te table TABLE1 that, also the records having one of the above fields empty, are saved.
How Come?
As I know, Raise FORM_TRIGGER_FAILURE must stop the trigger and then, no commit. It's not the case !
Can someone help me in that? Did I wrote the wrong trigger ?
Many Thanks for your help.
Imad QANDOUCI

you wrote an KEY-COMMIT Trigger. But you press KEY-EXIT. Why should KEY-COMMIT Trigger fire on KEY-EXIT?
Put your checks to PRE-INSERT and PRE-UPDATE triggers (to both!). Best, avoid duplicate code by writing a procedure consisting the checks and coll the procedure in the triggers.

Similar Messages

  • Why my screen iphone don't work well?

    Why my iphon's screen don't work well?

    Two things to try:
    First, reset the phone by holding the sleep and home button until the Apple logo comes back again. You will not lose data by resetting.
    If this does not work, set it up as new device, explained in this article:
    How to back up your data and set up as a new device
    If still no luck, your hardware might be damaged and the phone has to be serviced.
    iPhone - Contact Support - Apple Support

  • Color don't work well in Mac book pro 13"  and monitor flash sometimes? Please help me!

    Color don't work well in Mac book pro 13"  and monitor flash sometimes? Please help me!

    Please describe the problem in as much relevant detail as possible. The "etrecheck" fad hasn't made that step any less necessary. The usual results of posting etrecheck output on this site without a full description of the problem are very poor.
    The many "failed" warnings that etrecheck sometimes spews mean nothing. Those warnings are not a reason to reinstall the OS, or to do anything else at all. They should be ignored.
    The better your description of the problem, the better the chance of a solution.
    For example, if the computer is slow, which specific actions are slow? Is it slow all the time, or only sometimes? What changes did you make, if any, just before it became slow? Have you seen any alerts or error messages? Have you done anything to try to fix it? Most importantly, do you have a current backup of all data? If the answer to the last question is "no," back up now. Ask if you need guidance. Do nothing else until you have a backup.

  • RAISE FORM_TRIGGER_FAILURE is not working

    I am customizing a medical form with two blocks: cov_med_prem_header and cov_med_prem_lines. When user select emp_group from header, the list of medical program with end_date = '31-DEC-4712' will show at the detail block. Once a year at the open enrollment, HR will end date the previous year's program and enter the same programs but with different premium, also set the end_date = '31-DEC-4712'. In order to prevent user from enter to the wrong record, I added when-validate-record trigger for the detail block:
    declare
    max_effective_end_date DATE;
    begin
    select effective_end_date
    into max_effective_end_date
    from cov.cov_medical_premiums
    where emp_group = :cov_med_prem_header.emp_group
    and coverage_type = :cov_med_prem_lines.coverage_type
    and part_time = :cov_med_prem_lines.part_time
    and med_provider = :cov_med_prem_lines.med_provider
    and sysdate between effective_start_date and effective_end_date;
    if (:system.record_status = 'INSERT') and (max_effective_end_date = '31-DEC-4712') then
    MESSAGE ('YOU HAVE ENDTERED THE WRONG RECORD. PLEASE CHECK AND TRY AGAIN!');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    exception
    when others then null;
    end;
    But the RAISE FORM_TRIGGER_FAILURE is not working because the exception, but if I take out the exception part, I am not able to insert into the form, message like unhandled exception.
    Can anyone help with this? Thanks.

    Hi,
    There should not be an Exception part if you are using Form_Trigger_failure. So first find out what exception you are getting with the code, commenting out the raise form_trigger_failure. And first handle that, and then remove the exception part and use form_trigger _failure                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Raise form_trigger_failure is not working in multi-record block?

    raise form_trigger_failure is not working in multi-record block.
    Why?
    I am using Form 9i.
    Thanks and regards,
    Vikas

    Here is my code. Workorder_master is single block, workorder_dtls is multi-block.
    This code is written in KEY-NEXT-ITEM of labour_code in workorder_dtls.
    If suspended labour, invalid labour etc. is selected then it should not leave labour_code, but does not happen as I like. What will be the solution?
    DECLARE
    v_count                         NUMBER;
    v_status                    CHAR(1);
    v_workorder_no     VARCHAR2(15);
    v_pass_no                    VARCHAR2(15);
    v_rec_pos                    NUMBER;
    BEGIN
         IF :workorder_dtls.labour_code IS NOT NULL THEN
              v_rec_pos := :SYSTEM.CURSOR_RECORD;
              SELECT COUNT(*) INTO v_count FROM labour_master
                                  WHERE labour_code = :workorder_dtls.labour_code;
              IF v_count > 0 THEN --if labour exist.
                   SELECT status INTO v_status FROM labour_master
                                  WHERE labour_code = :workorder_dtls.labour_code;
                   IF v_status = 'I' THEN--'I' stands for busy.
                        --check if labour is for extension i.e. if labour is working for same workorder
                        SELECT COUNT(*) INTO v_count FROM workorder_dtls
                                            WHERE labour_code = :workorder_dtls.labour_code
                                            AND workorder_no = :workorder_dtls.workorder_no
                                            AND to_dt <= SYSDATE;
                        IF v_count > 0 THEN
                             --if working in same workorder then for extension, then give from_dt, to_dt
                             SELECT MAX(TO_DT)+1 INTO :workorder_dtls.from_dt FROM workorder_dtls
                                                 WHERE labour_code = :workorder_dtls.labour_code
                                                 AND workorder_no = :workorder_dtls.workorder_no
                                                 AND to_dt <= SYSDATE;
                        ELSE
                             --if not working in same workorder then give message.
                             SELECT workorder_no, pass_no INTO v_workorder_no, v_pass_no FROM workorder_dtls
                                                 WHERE labour_code = :workorder_dtls.labour_code
                                                 AND to_dt <= SYSDATE;
                             MESSAGE('This labour is already working through workorder no. '||v_workorder_no||' using pass '||v_pass_no);
                             MESSAGE('This labour is already working through workorder no. '||v_workorder_no||' using pass '||v_pass_no);
                             RAISE FORM_TRIGGER_FAILURE;
                        END IF;
                   ELSIF v_status = 'A' THEN--'A' stands for available.
                        :workorder_dtls.from_dt := SYSDATE;
                   ELSIF v_status = 'H' THEN--'H' stands for help-up.
                             SELECT workorder_no, pass_no INTO v_workorder_no, v_pass_no FROM workorder_dtls
                                                 WHERE labour_code = :workorder_dtls.labour_code
                                                 AND to_dt <= SYSDATE;
                        MESSAGE('This labour has been held-up for not submitting gatepass.');
                        MESSAGE('This labour has been held-up for not submitting gatepass.');
                        RAISE FORM_TRIGGER_FAILURE;
                   ELSIF v_status = 'S' THEN--'S' stands for suspend.
                             SELECT workorder_no, pass_no INTO v_workorder_no, v_pass_no FROM workorder_dtls
                                                 WHERE labour_code = :workorder_dtls.labour_code
                                                 AND to_dt <= SYSDATE;
                        MESSAGE('This labour has been suspended through workorder no. '||v_workorder_no||' using pass '||v_pass_no);
                        MESSAGE('This labour has been suspended through workorder no. '||v_workorder_no||' using pass '||v_pass_no);
                        RAISE FORM_TRIGGER_FAILURE;
                   END IF;
                   IF v_status IN ('A', 'I') THEN
                        :BLK_TEMP_WORKORDER.LABOUR_CODE := :WORKORDER_DTLS.LABOUR_CODE;     
                        GO_BLOCK('WORKORDER_DTLS_IMG');
                        EXECUTE_QUERY(NO_VALIDATE);      
                        GO_RECORD(v_rec_pos);
                        GO_ITEM('WORKORDER_DTLS.FROM_DT');
                        IF :workorder_dtls.from_dt + 180 <= :workorder_master.to_dt THEN
                             :workorder_dtls.to_dt := :workorder_dtls.from_dt + 180;
                        ELSE
                             :workorder_dtls.to_dt := :workorder_master.to_dt;
                        END IF;
                   END IF;
              ELSE --if labour does not exist.
                   MESSAGE('Invalid labour code');
                   RAISE FORM_TRIGGER_FAILURE;
              END IF;
         END IF;
    END;

  • Raise form_trigger_failure do not work

    Hi,
    I catch an error in on-error trigger and raise form_trigger_failure, this should be triggered when user clic <ok> button, that works, but in this screen user can go to menu and use another option that opens another screen, when user do that, the error message is displayed but form_trigger_failure do not raise and this another screen can be opened, does someone has any idea on how to fix it? Thanks.

    RAISED_FORM_TRIGGER_FAILURE will trigger only for the form whish has that command. So it will not failed when user navigate to anotyher form.
    What you want to do is if you get this message then poup a modal window and show the error. So at that time user unable to goto any other form because they can not navigate to any other window other than the modal window with the error
    Thanks
    * if this is correct/helpful then please mark it

  • Raise form_trigger_failure does not work in when-timer-expired trigger

    hi everbody,
    i create timer (no repeat) in when-validate-item trigger for an item then in timer i use raise form_trigger_failure for not posting related item.but raise form_trigger_failure not work in timer and cursor go next item ? do you say anything for that ? thanks..

    when your validation runs ok, then and only then you should create the timer and in the WTE you navigate to the other item.
    Think about: The WTE-trigger runs after the when-validate-item. It runs not within the WVI. That's the reason why you cannot cancel the WVI with the WTE.
    Only the WTE can be stopped with the Form_Trigger_Failure.

  • Safari don't work well

    My safari (latest version) not go well with my MBP (lion OSX). I don't know why everytime i open a web, it become just words without image or colour. Somebody help me.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode.) Post the results of steps 1 and 2.

  • New AE (n) don't work well with old AE's.

    Unfortunately, the new AE's don't seem to work very well with the old ones. Anyone else have this problem? Multiple problems, it seems. (Yes, I have the settings right).

    I have a similar problem with a TC and an older Express(g). I've not been able to figure out how to get them cooperating on a WDS network.

  • Can it be that OS 10 and Flash don't work well together? Internet browsers are freezing up

    I started this discussion on the macbook pro forum but no one has figured this out and I'm beginning to think this could be an OS 10 problem, so I'm posting here.  No matter what browser I use (Safari or Firefox), after a little bit of surfing, the browser freezes and I get the spinning circle of death. Only thing that works to fix it is to reboot. But then the cycle repeats. I've found discussions of other fixes for this but nothing has worked. So far I have:
    Added open source DNSs
    Updated all software
    Scanned for malware with Sophos (none found)
    Cleared browser caches
    Run disk utility and repaired all permissions
    Reset Flash settings to disable hardware acceleration
    Moved large files to an external hard drive to free up more disk space
    Checked to see if I have a bad Shockwave plug-in that was the culprit for others (didn't have it)
    Called Mac support and was advised to use disk utility
    None of this has worked. In other cases, people felt the problem had to do with flash. For them, changing the hardware acceleration setting (as I did) or removing the bad plug-in fixed the problem. This has not helped me, and I'm at a loss of what to try next. Of note, nearly every other instance I turned up about this involved SLeopard 10.6.6. That's what I was using. I updated to 10.6.8, but it didn't help. Any suggestions?
    I'm on a Macbook pro with 10.6.8, 4GB of ram and a 320GB hard drive showing 120GB free.

    First level Console messages are usually too general. Those are kind of generic and I'm not seeing anything related there to your problem. You need to open Console and navigate inside to system.log.
    This really needs fine some tooth troubleshooting. It could be so many things causing the problem. I'd call Apple back and get on the phone with a senior tech who can take the time to walk you through everything that needs to be looked at. Sounds like the tech you got either wasn't too skilled or ready to do that.
    One of the first things to try is to create a new admin user and test for this there. The Apple tech should have suggested this. If it doesn't happen there, you know it's specific to your regular account and not system wide.
    You could take a shotgun approach and throw Applejack at it. Make sure you do the underlined steps as well.
    Download:
    http://sourceforge.net/projects/applejack/
    Article on using:
    http://reviews.cnet.com/8301-13727_7-10334620-263.html?tag=mfiredir
    It runs in single user mode, where it runs more safely than other maintenance/cleaning programs because there is less chance of interference from the OS. After installing (you won't see it in the Applications Folder) hold CMD-S at startup. You will get a black screen with MS-DOS like text. Just follow the prompts: type in "applejack AUTO" and it will run through the following:
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Trash old Log files.
    You can also run tasks selectively and for specific users by typing in "applejack." After running in "AUTO,"  you can go back and run it again as "applejack," steps 3 & 4 only, for your user.
    The first reboot will take much longer than usual, as it rebuilds caches. It may take several restarts to see the benefits. Because of the deep cache cleaning in AUTO mode some applications may tell you they are being opened for the first time.
    NOT YET UPDATED FOR LION (although it is reported by some that it is working)
    (Adapted from post by BDAqua)

  • Cineform files don't work well on Mavericks

    Quicktime converts a CineForm file before playback in Mavericks. Why is that? Before Mavericks it worked just fine. Even previewing in a Finder-window isn't possible anymore. Anybody out there who knows why Apple has done this? Is there a workarround?

    Were all three 8330 devices you had having this same issue?
    Were they all gotten from the same store?
    I'd assume that store has a batch of bad devices. Exchange it from different location from a different batch.
    Or, better yet, for your troubles, ask VZW to upgrade you to a 9630 device
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Rhythmbox don't work well

    i have install the rhythmbox,just want to listen to the radio,but it didn't work,first of all,it couldn't even play mp3 file,after install the decoder by using the command:
    pacman -Sy codecs `pacman -Ss gstreamer | grep -e '^extra/gstreamer0.10' | awk '{print $1}'`
    i can play the mp3 file,but still couldn't listen to the radio,the following message came out:
    (rhythmbox:3433): Rhythmbox-WARNING **: Unable to initialize mDNS: Daemon not running
    (rhythmbox:3433): Rhythmbox-WARNING **: Unable to start mDNS browsing: MDNS service is not running
    (rhythmbox:3433): Rhythmbox-WARNING **: Unable to grab media player keys: Could not get owner of name 'org.gnome.SettingsDaemon': no such name
    [WARN 3447] polkit-session.c:144olkit_session_set_uid(): session != NULL
    Not built with -rdynamic so unable to print a backtrace
    ** Message: don't know how to handle text/uri-list
    Rhythmbox-Message: Missing plugin: gstreamer|0.10|rhythmbox|text/uri-list decoder|decoder-text/uri-list
    Rhythmbox-Message: Automatic missing codec installation not supported (helper script missing)
    ** Message: don't know how to handle text/uri-list
    Rhythmbox-Message: Missing plugin: gstreamer|0.10|rhythmbox|text/uri-list decoder|decoder-text/uri-list
    Rhythmbox-Message: Automatic missing codec installation not supported (helper script missing)
    (rhythmbox:3433): Rhythmbox-CRITICAL **: new_playing_stream_idle_cb: assertion `entry != NULL' failed
    what can i do?????

    i have already do exactly the same as the guide said
    pacman -S gstreamer0.10-gnomevfs
    pacman -S gnome-python
    i even activate the DAAP
    /etc/rc.d/avahi-daemon start
    but it still doesn't work
    Missing plugin: gstreamer|0.10|rhythmbox|text/uri-list decoder|decoder-text/uri-list

  • ICloud Mail & Contacts don't work well together?

    I have iCloud activated for Mail and Contacts. Now, when in Mail and I try to address an email, the address book shows up but none of the sub address books show up.  How do I get them populated?  Do I have to go back to syncing with MobileMe?

    this is not a bug - but you're right its a serious problem.
    The same happens on Linux/NVidia too igf I force antialiasing and use the OGL pipeline.
    This happens because java tries to accerlate some graphic opeerations with DirectX or OpenGL and it simply wants the graphic-card to render the stuff it sends the graphic card.
    However with AA turned on you graphic card tries to optimize the data coming from java which is nonsence since the AA was designed for games.
    So basically its neither java's fault nore the dirvers one.
    Both work as expected - but not well together. I think driver-manufactureres should provide a common API for telling the driver that this and that application does NOT want to be AA'ed even if its forced.
    Till now there's nothing SUN could do about this issue...
    lg Clemens

  • The sites I make with iWeb don't work well on Windows!

    I've made a site with iWeb 08 and it works fine with Safari, and at times with Firefox.
    However, it has some "glitches" when you use Internet Explorer on a Windows based computer.
    Especially the "Search" button.
    Has anyone noticed this? Is there a fix?
    I'd like all type of users to view this site, not just Mac users.

    IE (especially versions 6 and below) are notoriously non-compliant. There is not much you can do if your visitors are using IE other than place a small warning on your site that says something along the lines of 'Best Viewed in FF or Safari, although strictly speaking this is against accessibility guidelines and not good web design practice.
    You could try and incorporate a bespoke Google search into your site as a replacement.
    Hope that helps
    AAi

  • Preview don't work well in exhibit exif parameters

    If I choose italian language preview don't show exif parameters.
    Instead if i put english language, all is ok.
    Someone knows haw resolve this issue?
    thanks

    seems fixed with this method:
    http://groups.google.it/group/it.comp.macintosh/browse_frm/thread/6954f6bcc67df8 a8/7860bf2927f8380d

Maybe you are looking for

  • File Type Icons Not Working

    Hey everyone, the issue I'm haveing is not just with Photoshop, but sense I couldnt find a general CS5 forum, and Photoshop was the last CS5 application I noticed this for I'm hoping to find some answers here. So on to the issue.... I have noticed th

  • ISE 1.3 Remove fields from the Sponsorportal

    Hello, we´ve recently upgraded our ISE 1.2 to version 1.3 and now I need to remove the Fields "Phone number", "Reason for visit" and Group Tag from the Sponsorportal. I couldn´t find it in the backend or in the CSS-File. Where can I do that? Help is

  • HT204370 how can i get a downloaded film to play ? it just keeps playing the trailer

    How can i get the film to play ?

  • Is it mandatory to create a project for every enhancement?

    Hello Gurus, I have written some code in one user exit. Now i have activated it and it is working fine. I wanted to know. is mandatory to create a project(in CMOD) for every user exit? Also what is the functionality of the project?

  • Badi or User Exit for Multi CRM scenario?

    Hi Gurus, we have two different CRM systems connected to one ECC system. We are stucking with number ranges for Sales Orders. In fact we are thinking to set for the two CRM systems the same internal number range and then implement a Badi or an User E