Where's the WHEN-NEW-BLOCK-INSTANCE trigger gone?

Not a rehash of my famous UKOUG presentation but a genuine question.
If I start up a Form with ENTER_QUERY in the WHEN-NEW-FORM-INSTANCE trigger then WHEN-NEW-BLOCK-INSTANCE never fires. I just get a WHEN-NEW-RECORD-INSTANCE. This is true whether the query is executed or cancelled.
I have replicated this behaviour inb both Forms 4.5 and 9i Forms so I assumed this is standard behaviour and well-known by everybody but me. The question is: why is Forms designed like this? I can just about see why WHEN-NEW-BLOCK-INSTANCE might not fire in QUERY-MODE, even though WHEN-NEW-RECORD-INSTANCE does, but why doesn't it fire after the query is executed or cancelled?
Cheers, APC

Interesting...
I am aware that the when-new triggers do not run in some cases. On the other hand, the post- triggers run over and over again, to the point that I just don't use them because any code put there executes too many times.
If you have several go_item or go_block triggers in a key trigger or when-button-pressed trigger, the when-new-item-instance trigger does not run each time you do a go_item. Instead, the when-new triggers ONLY run on the last item or block, just after my key-trigger code completes, and just before control returns to the user.
So it would seem natural that if you go_block in a when_new_form_instance trigger, and execute an Enter_Query command, then the when-new-block-instance would not run.
The fact that it does not run once you cancel the query just doesn't seem right, though.

Similar Messages

  • FRM-40735: WHEN-NEW-BLOCK-INSTANCE trigger raised unhandled exception ORA-0

    I have created two control blocks.In the second control block an item is getting data depending on the value of a particular item in the 1st control block.
    I am fetching data for the item in 2nd block using WHEN-NEW-BLOCK-INSTANCE trigger in the 2nd block
    It is giving the following error
    FRM-40735: WHEN-NEW-BLOCK-INSTANCE trigger raised unhandled exception ORA-01403
    When I am giving the following code, it is working
    SELECT BM_MR_LCL_STD INTO :BLOCK2.ITEM5 FROM FABRIC_TYPE_MAST_DVLP WHERE FABRIC_TYPE = 'AT';
    But when I am giving the below code, it is not working,
    SELECT BM_MR_LCL_STD INTO :BLOCK2.ITEM5 FROM FABRIC_TYPE_MAST_DVLP WHERE FABRIC_TYPE = :BLOCK1.ITEM4;
    Please Help.
    Regards,

    That means there were no rows in the table which matched the criteria in your query. You need to trap the no_data_found exception, eg
    exception
      when no_data_found then
        :block2.item5 := null;
    end;and if fabric_type is not unique then you'll need to trap the too_many_rows exception too.
    I think for this you might be better off with an explicit cursor.

  • FRM-40735: WHEN-NEW-BLOCK-INSTANCE trigger raised unhandled exception

    Hello,
    I get the following error FRM-40735: WHEN-NEW-BLOCK-INSTANCE trigger raised unhandled exception ORA-06502 in an R12 customized form . I have no code in when-new-block-instance . In my when-new-form-instance there's only
    CLEAR_FORM(NO_VALIDATE);
         GO_BLOCK('blockname');
         EXECUTE_QUERY;
         SHOW_VIEW('CAN_STK1');
         go_item('version_no');
    Any help please ?

    twinklin_girl wrote:
    Hello,
    I get the following error FRM-40735: WHEN-NEW-BLOCK-INSTANCE trigger raised unhandled exception ORA-06502 in an R12 customized form . I have no code in when-new-block-instance . In my when-new-form-instance there's only
    CLEAR_FORM(NO_VALIDATE);
         GO_BLOCK('blockname');
         EXECUTE_QUERY;
         SHOW_VIEW('CAN_STK1');
         go_item('version_no');
    Any help please ?Please do the following to get more details about the error.
    - Obtain FRD files -- https://forums.oracle.com/forums/search.jspa?threadID=&q=FRD+AND+R12&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    - Obtain debug log -- How to Obtain Debug Log in R12 [ID 787727.1]
    Thanks,
    Hussein

  • When-new-block-instance trigger

    Hi All
    Could You please help me in writing this trigger ?
    My requirement is ' For one responsibility,Insert,Delete,Update and Query must be allowed and Other Responsibility,only Query should be allowed.Here the Responsibilities are 1. Purchasing Super User and 2.Purchasing User respectively.Please tell me how to write this trigger with these conditions.It is very urgent.
    Thanks & Regards
    Rajesh

    try with
    if role = 'super user' then
    set_block_property('urblock',insert_allowed,property_true);
    set_block_property('urblock',update_allowed,property_true);
    else
    set_block_property('urblock',insert_allowed,property_false);
    end if;

  • How can i change the code in when new form instance trigger using JDAPI

    Hi all,
    Can anyone tell me how can i use JDAPI to modify the when-new-form-instance trigger in all my forms,coz we have around 500 FMB's ,if this is possible by using jdapi it will be better for us..
    Thanks in advance..
    Najeeb

    Hi Najeeb,
    The code I've given you should cover the basic steps - you will need to have a basic knowledge of Java if you want to use the JDAPI, there's no way around that unless you go and buy one of the off-the-shelf products for this kind of thing (I think there's one called orcltoolbox..?)
    I've written an application that does all kinds of things to Forms specific to our needs, so it's a bit tricky to just pull out the code you need, but again, the basics will be:
    String formName="C:\some_dir\some_form.fmb";
    FormModule mForm=FormModule.open(formName);
    Trigger myWNFITrig=Trigger.find(mForm,"WHEN-NEW-FORM-INSTANCE");
    String myText=myWNFITrig.getTriggerText();
    And there you have your trigger text, to do with what you please. You could put this code in the main() method of one class if you want to keep things really simple - but see how you get on, if you have any more specific questions, do come back.
    Eric - that's a very good point about using Regular Expressions. I haven't used them in my JDAPI app because I wanted to keep all my .fmbs 6i-compatible for the short-term, and a posting I saw somewhere recommended sticking to Java 1.3. Which rules out the regex facility, which only appeared in Java 1.4. Now, though, I think I needn't have worried - it surely shouldn't matter which version of Java I use to make the changes to the .fmbs. My stupid!
    James

  • WHEN-NEW-FORM-INSTANCE trigger does not fire

    Hi,
    Does anyone have any idea why code placed in the when-new-form-instance trigger appears to be ignored when the form is executed from one login but runs fine when executed from another? A breakpoint on the first executable line of code in the trigger confirms that the trigger is not being fired.
    Regards,
    Ian Dodds.

    Hi again Duncan,
    I was able to solve it once I ran the form with the Forms Runtime Diagnostics enabled. I had a table in my schema containing old data used to build menu items. This was causing runtime errors to occur during calls to SET_MENU_ITEM_PROPERTY that were not being propagated to the UI so I didn't know they were occuring.
    The upshot was that the WHEN-NEW-FORM-INSTANCE trigger was not firing. Once I corrected the data it worked a treat.
    Thanks very much for pointing me towards FRD, it's the first time I've used it but it won't be the last.
    Cheers,
    Ian.

  • Populate two poplist items on when-new-form-instance trigger

    Hello!
    I have a simple form with some text-items, datetime items, two poplist items and two buttons (exit and save to database).
    Everything works well except the second poplist wont get populated. After wrote the code for the first i just wrote a similar one for the second poplist. Each poplist fetches its data from different tables. Nothing changed when i tried different list-item types (first worked, second didnt).
    Here is the code in the when-new-form-instance trigger:
    declare
         rg_query_sponsori varchar2(200) := 'select nume, sponsor_id from sponsori';
         rg_id_sponsori recordgroup;
         err_sponsori NUMBER:= 0;
    rg_query_portari varchar2(200) := 'select nume, portar_id from portari';
         rg_id_portari recordgroup;
         err_portari NUMBER:= 0;
    BEGIN
         rg_id_sponsori := create_group_from_query('recgrp1',rg_query_sponsori);
         err_sponsori := populate_group(rg_id_sponsori);
         clear_list('vizitatori.sponsor_id');
         populate_list('vizitatori.sponsor_id',rg_id_sponsori);
         rg_id_portari := create_group_from_query('recgrp2',rg_query_portari);
         err_portari := populate_group(rg_id_portari);
         clear_list('vizitatori.portar_id');
         populate_list('vizitatori.portar_id',rg_id_portari);
    END;
    Thx and have a nice weekend :)
    Iulian

    Try this by adding delete_group
    declare
    rg_query_sponsori varchar2(200) := 'select nume, sponsor_id from sponsori';
    rg_id_sponsori recordgroup;
    err_sponsori NUMBER:= 0;
    rg_query_portari varchar2(200) := 'select nume, portar_id from portari';
    rg_id_portari recordgroup;
    err_portari NUMBER:= 0;
    BEGIN
    rg_id_sponsori := Find_Group('recgrp1');
    if not id_null(rg_id_sponsori) then
    delete_group('recgrp1');
    end if;
    rg_id_sponsori := create_group_from_query('recgrp1',rg_query_sponsori);
    err_sponsori := populate_group(rg_id_sponsori);
    clear_list('vizitatori.sponsor_id');
    populate_list('vizitatori.sponsor_id',rg_id_sponsori);
    rg_id_portari := Find_Group('recgrp2');
    if not id_null(rg_id_portari) then
    delete_group('recgrp2');
    end if;
    rg_id_portari := create_group_from_query('recgrp2',rg_query_portari);
    err_portari := populate_group(rg_id_portari);
    clear_list('vizitatori.portar_id');
    populate_list('vizitatori.portar_id',rg_id_portari);
    END;

  • Verifying Responsibility in a When-New-From-Instance Trigger

    Hi All,
    I want to restrict the accessability of a form to different responsibilities using resp_id, how do I do that? Is there any other method of by which I can restrict the accessibilty to different responsibilities?can we use system variables? Any help would be appreciated.
    Thanks,
    Karthik

    If you write code that is run by the when-new-form-instance trigger which checks resp_id against the userid in some type of access table, your form can then choose to continue or not. If it cannot continue, it could either exit or call another form, depending on how it was started.

  • WebUtil doesn't work when called from WHEN-NEW-FORM-INSTANCE trigger

    I need WEBUTIL_CLIENTINFO functions to know some information from the client, like IP, JavaVersion, Hostname, OS user, etc. This functions I call through WHEN-NEW-FORM-INSTANCE TRIGGER and this doesn't nor work. I obtain the next message and error:
    oracle/forms/webutil/clientinfo/GetClientInfo.class not found. WEBUTIL_CLIENTINFO.GET_IP_ADDRESS.
    But when I call this WebUtil functions through WHEN-WINDOW-ACTIVATED trigger or through a button it works. Why?. I need call WebUtils in the WHEN-NEW-FORM-INSTANCE trigger!
    Any help will be of great value.

    Basically make a timer...
    Do you have the wu_test_106.fmb file that comes with the webutil install?
    If you look in the wnfi trigger you will see this...
    declare
         fake_timer TIMER;
    begin
         -- Purpose of the fake timer is the we cannot call webutil in this trigger since the
         -- beans have not yet been instantiated.  If we put the code in a when-timer-expired-trigger
         -- it means that this timer will not start running until Forms has focus (and so the webutil
         -- beans will be instantiated and so call canbe made.
         fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
         --create_blob_table;
         null;
    end;And in the form level when-timer-expired you will see this...
         :global.user_home := webutil_clientinfo.get_system_property('user.home');
         :OLE.FILENAME := :global.user_home||'\temp.doc';
         SET_ITEM_PROPERTY('builtins.text_io_item',PROMPT_TEXT,'Write to '||:global.user_home||'\helloworld.txt');
         SET_ITEM_PROPERTY('files.userdothome',PROMPT_TEXT,:global.user_home);

  • FRM-40735: WHEN-NEW-FORM-INSTANCE trigger raised unhandled except ORA-06508

    Dear Colleague,
    I am migrating a Forms application from Forms 9i to Forms 10g. Most of my forms were originally created using the Oracle Designer Forms generator. I am also using the Webutil plugin. I just finished configuring Webutil, tested it and it seems to be working fine.
    I am able to compile all code and generate a Form executable. However at runtime, I get an error as soon as the first line of code in the WHEN-NEW-FORM-INSTANCE trigger.
    The error is:
    FRM-40735: WHEN-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-06508
    and the beginning of the code is as follows. Using the debugger, I found out that the line:
    CGBS2$.SET_COORD_STYLE( 'P' );
    initiates an error.
    /* CGLY$INIT_CANVASES */
    /* Call procedure to ensure correct canvases are visible */
    BEGIN
    CGBS2$.SET_COORD_STYLE( 'P' );
    CGBS2$.SET_QRY_ON_ENTRY( 'Y' );
    CGBS2$.SET_NAV_FROM_BLOCK( 'PROJ_BLOCK' );
    CGLY$CANVAS_MANAGEMENT;
    END;
    Is the error telling me that this procedure was not found? How can I proceed to find the cause and solution of my problem? Are one of the Oracle Designer Forms Generator libraries missing?
    I would appreciate a tip to help me begin seeing the light at the end of the tunnel.
    Thanks and regards,
    Randy

    Randy,
    Glad I could help and you've got your Form running.
    @user9230833
    It is consider "bad form" to usurp another's post. Please create your own Forum post and include a link or links to any relevant posts. As to Randy's situation, he simply compiled the Forms 9i Library module (.pll) with Forms 10g's compiler. This may not be the cause of your error. When you post your own question, please include your Forms version (full version [eg; 10.1.2.0.2] not the release [6i, 9i, 10g, etc]). Also include any sample code that might help us help you! ;-)
    Craig....

  • FRM 40735 : WHEN-NEW-FORM-INSTANCE Trigger raised unhandled exception

    Hi all,
    I'm from a support team.
    Here we have a 3 database in 2 servers connecting to a single application.
    Only one Db will be connected at all time , other DB's are backup.
    Here the issue is 2DB DBs residing on the same server were able to cennect to the application and doesn't through any error. But the 3rd one in different server gives the below error,
    FRM 40735 : WHEN-NEW-FORM-INSTANCE Trigger raised unhandled exception ORA-06508
    The Forms were compiled using the First DB , that time when i access the app using the 3rd db i'm getting the above error.
    But when I compile the form using the 3rd DB and connect to the App its working fine (The size of the form gets reduced during the compilation).
    Thanks for your help in advance.
    Srinivasan.K

    Could be a timestamp vs signature issue - forms is calling a database procedure in the WHEN-NEW-FORM-INSTANCE trigger and the procedures have different compile times on the different dbs and it's set to use timestamp to determine if a procedure has changed. You can change remote_dependecy_mode = 'Signature'.

  • Webutil crashes while calling Function in when-new-item-instance-trigger

    Hello !
    I use Oracle AS 10.1.2 and webutil 1.0.6 and Oracle Forms Developer Version 10.1.2.
    When I call the webutilfunctions within a when-button-pressed or post-change trigger, everything works fine.
    When I call the webutilfunctions within a when-new-item-instance-trigger i get an error message:
    oracle.forms.webutil.file.FileFunctions bean not found.
    CLIENT_TEXT_IO.fopen will not work
    What are the reasons for this behavior ? How can I solve the problem ?
    PLEASE HELP !!!!!!!!

    I think that this is well explained in the webutil documentation(pdf).
    You cannot use the functions in the initialisation phase of the form, including triggers like When-New-Form-Instance, When-New-Block-Instance,etc...
    The workaround is to use a timer to wait the necessary time for the beans to instantiate themselves.
    Francois

  • When-new-form-Instance trigger raised unhandled exception ORA-04062

    Hi,
    We are facing ORA-04062 (FRM-40735 WHEN-NEW-FORM-INSTANCE trigger raised unhandled exception ORA 04062) while trying to run the first form of our Application.
    We are using a PL/SQL LIBRARY(.pll) for forms.
    We are using 10G Application Server,10G DB and Oracle 9i Forms.
    DB Version----10.1.0.4.0
    Application Server--9.0.4.0
    During compilation, we are following the below steps:
    1. Compile the .pll
    2.Compile Forms.
    When we are running these compiled version of forms and pll in Development server where we are compiling it,we are not facing any error.
    But when we are taking these compiled version of forms and pll to the Production Server,we are getting the above error.
    When we are compiling the .pll in Production server, Application runs fine.
    But we should not compile form or pll in Production server.
    Searching in Metalink(Note:73506.1) , we find a solution that remote_dependency_mode if set to signature this problem may be resolved.
    We tried that by chaning ' REMOTE_DEPENDENCIES_MODE=SIGNATURE' in Init.ora file in both Production and Development server.
    But the error still persist.
    I think the problem is regarding .pll.Because for the time being to test the application,I compiled the pll in Production and we didnot get any error while running the Application.
    But whenever we are tring to deploy the compiled version of pll (compiling in Development sever) and to run the application in Production, we are facing the error.
    Also, pll calls one standard database package in SYS.That standard package has VALID status both in Production and in Development.
    We donot have priviledge to change/compile that package.So,we didnot change anything in that package. We didnot change anything in .pll also.
    We are upgrading our forms from 6i to 9i.And now when we are trying to deploy it to Production we are facing ORA-04062 error.
    Can anyone please help ?

    Exactly what procedure or package in SYS are you calling that causes this problem?
    <p>Are both test and production databases at the same version?
    <p>Do you know what procedure or package is named in the error? If not, then you need to improve your on-error trigger processing. I use a PLL_On_Error trigger to capture and improve a number of Oracle messages. It is posted here:
    <p> Re: FRM-40735:Pre_Insert trigger raised unhandled exception ORA-20011
    <p>Note especially the part near the end that deals with FRM-40735. (Not sure, but you may also want to display DBMS_ERROR_TEXT in your situation.)
    <p>If that doesn't help find the actual problem, I would pull out my Re: Zdebug -- Download a Forms debugging message tool, and add messages before every call in the when-new-form-instance process to zero-in on the offending call.
    <p>If it really IS a call to a system process, I would then experiment with creating a server-side package or stored procedure that calls the process, and then call that stored procedure from my form. That way, you effectively insulate your form from system differences.

  • FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger

    Hi Guys,
    Can someone help me to find the root cause of my follwoing issue
    Issue
    My Sales Order was giving following error when trying to open the form
    'FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger '
    Bounced the instance the issue was resolved.
    Again today morning ,same issue started again after the daily bounce which is done bu a script.
    This time I bounced Form server and issue was resolved.
    Can someone help me in finding the root cause of this issue.
    This is issue is happening only on one form (Sales Order ) !!!!!
    Thanks

    Hi
    This is a Standard form using cusom.pll.
    This was working perfect for last 1 year.
    There where no changes made in the forms or in the environment.
    Only activity carried out was a rebooting of server.
    Surprising it is working fine after boucing!!!!
    any idea
    Thanks

  • FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger raised unhandled exception

    I have a form that I migrated to 10g from 6i. I have no problems with it in 6i.
    When I launch this migrated form on the web in 10g, I get the following error:
    Error: FRM-40735: WHEN-NEW-RECORD-INSTANCE trigger raised unhandled exception ORA-03127From oracle error code
    03127, 00000, "no new operations allowed until the active operation ends"
    // *Cause: An attempt was made to execute a new operation before the active
    //         non-blocking operation completed or a new operation was attempted
    //         before all the pieces of a column were inserted or fetched.
    // *Action: Execute the new operation after the non-blocking operation
    //          completes. If piecewise binds/defines were done, execute the new
    //          operation after all the pieces have been inserted or fetched.What does the above suggested action mean?
    Any suggestions.
    Thanks

    Run the debugger and see what line of code is failing.

Maybe you are looking for

  • HP Color LaserJet 1500L add windows 8.1

    I can't find the driver for my printer (HP Color LaserJet 1500L) for windows 8.1.

  • Printing Dark Background Converted PPT

    Hello, I have got a Power Point presentation in PDF format send by my professor, i have to print it out but it has got dark bakground and will use a lot of ink so to resolve i search out the method to change background and reached to the option of Ac

  • HP Solution Center Problem

     I have an HP Pavillion a1400e desktop with an HP PSC 1410 All-In-One printer, scanner.  I've been using HP Solution Center to scan.  I now get the message "No HP devices detected" with HP Solution Center.   I can still print documents (not using the

  • Problem with logic:equal

    hi! i have a problem with my code. <logic:iterate id="_contilist" name="contilist"> <logic:iterate id="_continentall" name="continental"> <logic:equal name="_continentall" property="val(GCCSL_SL_ID)" value="_contilist.val(SL_ID)"> <tr class="list">TE

  • How can I connect Internet with my 10.4 PowerBook

    How to connect my own Internet connection to my new PowerBook 10.4.8