Forms equivalent trigger in adf

How can I write a method such that it will select the maximum value of a column and set the value for the column in the current row as (maximum value of the column + 1)

Hi,
it depends on what your business service is. If it is ADF Business Components then you would write this in the EntityObjectImpl class as part of the setAttr() method. Note that similar to Forms ADF BC caches data, which means that unless your application commits each change, you risk to have concurrend users picking up the same value. I suggst to use DB sequences instead
Frank

Similar Messages

  • Oracle Forms equivalent operations in Oracle ADF

    I need to know whether there are equivalent operations in ADF corresponding to these operations in Oracle Forms
    System.Current_block
    System.Current_record
    System.Current_form
    etc...

    As a mechanism to working out how ADF works, a suggested read is the Fusion Dev Guide: http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/toc.htm
    Once you've done this, as extension the dev guide has appendixes "F - ADF Equivalents of Common Oracle Forms Triggers" & "G Performing Common Oracle Forms Tasks in Oracle ADF" for assisting Forms programmers in moving to ADF, a feature/mind map as you will.
    However as Vinod says, don't make the mistake of thinking ADF is similar to Forms in its implementation. While Forms and ADF attempt to achieve similar results (ie. applications querying data from a db and showing to the user to view or edit), they do it in totally different technologies.
    CM.

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

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

  • 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

  • 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);

  • Why same query runs on isqlplus but not in Forms/Reports trigger

    Hi,
    I have one query in which I extract one column with parent table join if I run same query on isqlplus prompt it works but if I run same on Forms/Reports trigger it says found "select" where something else expected.
    below is an example .
    select em1.mreading, em1.grid_code,
    (select em.mreading from energy_mreading em where em.grid_code=em1.grid_code and em.transformer_code=em1.transformer_code
    and em.bus_bar=em1.bus_bar and to_date(to_char(em.r_date,'dd/mm/yyyy'),'dd/mm/yy') = to_date('02/01/07' ,'dd/mm/yy') - 1)
    as Yreading
    from energy_mreading em1
    where to_date(to_char(em1.r_date,'dd/mm/yyyy'),'dd/mm/yy')= to_date('02/01/07' ,'dd/mm/yy')
    Any one can help me, is there any restriction/limitations in Forms/Reports triggers.
    Thanks, Khawar.

    In forms and cursors you can not use scalar subqueries as you do. You have to use joins!
    select
         em1.mreading
        ,em1.grid_code
        ,em.mreading as Yreading
    from
        energy_mreading em1
       ,energy_mreading em
    where 1=1
        and trunc(em1.r_date) = to_date('02/01/2007','dd/mm/rrrr')
        and em.grid_code = em1.grid_code
        and em.transformer_code = em1.transformer_code
        and em.bus_bar = em1.bus_bar
        and trunc(em.r_date) = trunc(em1.r_date) - 1
    Try this, hope it works.

  • Free Forms Modernization and Oracle ADF event running June 6th 2011

    Oracle partner iAdvise are running a full day workshop on Forms modernization and Oracle ADF in Belgium on the 6th June 2011. For those interested in JDeveloper and ADF, there is a full afternoon of ADF training, as well as a copy of the Quick Start Guide to Fusion Development JDeveloper and Oracle ADF.
    You can register here:https://www.iadvise-hosting.be/pls/apexsaas2/f?p=eev:104:4479387178760612%20
    So, if you have any investment in Oracle Forms and are looking at ADF, you need to attend!

    bump

  • Block level trigger vs form level trigger

    Hello.
    I want to know what is better - to use block or form trigger?
    I have many blocks in my form. I need to write custom code in (for example) key-crerec trigger.
    Should i put trigger into each block or should i create one at form level like:
    if :system.current_block = 'BLOCK1' then
    create_record;
    elsif...
    end if;
    Thanks.
    Message was edited by:
    DejanH

    Hello,
    If you have to handle this stuff in more than one block, it seems more generic to put the code in a form-level trigger if you don't want to duplicate it several times.
    Francois

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

  • 40735 WHEN-NEW-FORM-INSTANCE-TRIGGER raised unhandled exception ORA-06502

    After migrationg my form from 6i to 10g I am getting the 40735 WHEN-NEW-FORM-INSTANCE-TRIGGER raised unhandled exception ORA-06502 err msg. the field is a date field and should be automatically populated with sysdate- 365. but when i open the form to run it is not populated automatically. i have to enter the date manually. the code in the NEW-FORM-INSTANCE trigger is as follows:
    declare
    record_id RecordGroup;
    error_cd number;
    begin
    -- Set the main window properties
    set_window_property(forms_mdi_window, window_state, maximize);
    -- Menu Security
    set_menu_items;
    select sysdate - 365
    into :start_date
    from dual;
    end;
    I check the property palate for the start_date field and it looks ok. the form is working fine in windows but the above message is comming out while running the form in Unix.
    Any help will be greatly apreciated.

    First thing, try qualifying the start_date with the block name
    declare
    record_id RecordGroup;
    error_cd number;
    begin
    -- Set the main window properties
    set_window_property(forms_mdi_window, window_state, maximize);
    -- Menu Security
    set_menu_items;
    select sysdate - 365
    into :block.start_date
    from dual;
    end;

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

  • FRM-40735: WHEN-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-01

    Hello,
    when I run my form I am getting the following error:
    FRM-40735: WHEN-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-01422
    My WHEN-NEW-FORM-INSTANCE trigger is calling to procedures. below is the code in my trigger
    begin
    Get_User_Info;
    Get_org_num;
    end;
    what could be the problem ?
    thanks in advanced,
    AJ

    One of your procedures must be doing a "select into" but the select is returning more than one row. Examine the queries your procedures are doing.
    Gary

  • How to make form based authenticaiton in adf security?

    Hi all
    How to make form based authenticaiton in adf security?
    help give example video or project.
    Thanks lhagva

    Have you read the docs (http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/adding_security.htm)?
    Timo

Maybe you are looking for

  • Passing parameter to the i18n text from xml view in fiori app

    Hi, Could somebody let me know how to pass parameter to get the i18n text inside xml view of a Fiori app. For e.g. inside my i18n properties file i have a entry like: PEC_ISSUE={0}issues of total{1} inside xml i use it like {i18n>PEC_ISSUE} but now h

  • Shortcut to widen column doesn't work

    Any shortcut for the "Grow Area" using the function name "Right Size This Column" (Select the vertical equals sign on the bottom right corner of a column and press the Control Key) doesn't work. I restart after setting it. I use "Shift, Option, Comma

  • This computer is not authorized to play Song name

    Hi A couple of weeks ago I tried bying a ringtone from my iPhone and it worked fine. But after syncing with my Mac Mini iTunes i get the error message This computer is not authorized to play <Song name>. Would you like to authorize it? I've tried de-

  • Differences between ASEE 8.1 and 8.0

    Hello, Where can I found an exact list of all differences between Sun Java System Application Server Enterprise Edition 8.1 and 8.0 ? Thanks in advance

  • Spawn loops at runtime

    Hi, I want to program a timed loop that spawns new parallel processes (e. g. while loops) at specific points in time. It's kind of a C++ loop that dynamically creates thread objects at certain interation points and calls the thread member function st