Multirecord block & when-button pressed

Forms10g
In a multirecord block there's a button displayed for each row.
Problem is:
Focus doesn't change to the row where button is pressed before executing the "w-b-p" trigger logic and therefore correct context information is not passed !
I've tried to get form to synchronize:
synchronize;
go_record(:system.trigger_record); and also
go_record(:system.cursor_record);
but system variables are not being set before executing "w-b-p trigger" ?
HAs anyone got a workaround for this ?
Thanks
Pete

Set the Mouse Navigate property to TRUE/YES on the button

Similar Messages

  • Error -- No Such Trigger('when-button-pressed')

    Hi,
    I am getting the error ""No Such Trigger('when-button-pressed')"",
    when I am executing the code EXECUTE_TRIGGER( 'WHEN-BUTTON-PRESSED' );
    on some item(Key-Next-Item), although WHEN-BUTTON-PRESSED trigger exists.
    What could be the problem ?. It worked till yesterday, giving error from today, I havent
    changed any thing.
    Thanks in Advance
    Devender

    Steve's tip is the only good solution for this case.
    The problem in your case for example is:
    Let's say you have a block-trigger, which fires after your execute-trigger.
    Now a colleague of you, which don't know your code, create a WHEN-BUTTON-PRESSED on an item, then the new code is started and not the block-trigger-code.
    So, don't ever do this. Write your code in a package-function or -procedure and call it from the trigger. So you can re-user the functionality
    Gerd

  • Requerying in WHEN-BUTTON-PRESSED

    Hi,
    I have two forms. I have a button that opens up modal form 2 from form 1 and passes some parameters. I allow the user to update something in form 2 (which has an effect on form 1). When user exits form 2, I want to requery the block in form 1 so that any updates effected in form 2 can be visible.
    I tried putting in a do_key('execute_query') in the WHEN-BUTTON-PRESSED trigger in form 1 after the call to open form 2. This had no effect (probably because it didn't get called when I expected it to). The only way I am able to get the new data (after an update in form 2) is to manually issue a requery in form 1.
    Any suggestions would be deeply appreciated!
    Thanks,
    Niranjan

    Hi Niranjan
    Put the Execute_query in the when-new-form-instance of the Called form.
    With Regards
    Harish
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Niranjan Ramakrishnan:
    Hi,
    I have two forms. I have a button that opens up modal form 2 from form 1 and passes some parameters. I allow the user to update something in form 2 (which has an effect on form 1). When user exits form 2, I want to requery the block in form 1 so that any updates effected in form 2 can be visible.
    I tried putting in a do_key('execute_query') in the WHEN-BUTTON-PRESSED trigger in form 1 after the call to open form 2. This had no effect (probably because it didn't get called when I expected it to). The only way I am able to get the new data (after an update in form 2) is to manually issue a requery in form 1.
    Any suggestions would be deeply appreciated!
    Thanks,
    Niranjan<HR></BLOCKQUOTE>
    null

  • FRM-40735:when-button-pressed trigger raised unhandled exception ORA-24247

    hi all
    i am using form 10g release2 i am having a problem
    when i use the following stored procedure in form then i am getting this
    error.
    FRM-40735:when-button-pressed trigger raised unhandled exception ORA-24247
    but the same code working fine when i use in SQLPLUS.
    CREATE OR REPLACE PROCEDURE mail_attach (dir1 VARCHAR2, filename VARCHAR2)
    AS
      l_output  utl_file.file_type;
      l_file       RAW(32767);
      l_size       NUMBER;
      BLOCK       NUMBER;
      b          BOOLEAN;
      l_start NUMBER := 1;
      TYPE ARRAY IS TABLE OF VARCHAR2(255);
      l_data ARRAY := ARRAY([email protected]');
    BEGIN
      UTL_FILE.FGETATTR(dir1, filename, b, l_size, BLOCK);
      l_output := utl_file.fopen('BACKUP', 'code.txt', 'r' );
      utl_file.get_raw(l_output, l_file, l_size);
      utl_file.fclose( l_output );
      FOR i IN l_start .. l_data.COUNT
      LOOP
        UTL_MAIL.SEND_ATTACH_RAW (
            sender   => 'Mailer',
            recipients => l_data(i),
            subject   => 'Data for ' || TO_CHAR((SYSDATE-1),'DD-MON-YYYY'),
            attachment => l_file,
            message   => 'Dear User, Please find attached the upload
    data for the period mentioned in the subject line.',
            att_inline => FALSE,
            att_filename => filename);
           l_start := l_start + 1;
      END LOOP;
    END;and this is used in form when-button-pressed trigger.
    BEGIN
      mail_attach('UTL_PATH','code.txt');
         message('FIle send successfully');
         message('File send successfully');
    END;

    hi
    Mehwish now check the following code and its working fine with me in form..........
    declare
         dir1 VARCHAR2(200);
          --filename VARCHAR2(200):='Logon.jpg';
           filename VARCHAR2(200);
      l_output  utl_file.file_type;
      l_file       RAW(32767);
      l_size       NUMBER;
      BLOCK       NUMBER;
      b          BOOLEAN;
      l_start NUMBER := 1;
      TYPE ARRAY IS TABLE OF VARCHAR2(255);
      l_data ARRAY := ARRAY('[email protected]');
    BEGIN
    -- EXECUTE IMMEDIATE 'ALTER SESSION SET smtp_out_server = ''192.168.56.103:25''';-- this is IP address and port of the server
      UTL_FILE.FGETATTR(dir1, :filename, b, l_size, BLOCK);
      --select directory_path into :filepath from dba_directories where directory_name='BACKUP';
      l_output := utl_file.fopen('BACKUP',:filename, 'r' );-- i added :filename as a text item.
      utl_file.get_raw(l_output, l_file, l_size);
      utl_file.fclose( l_output );
      FOR i IN l_start .. l_data.COUNT
      LOOP
        UTL_MAIL.SEND_ATTACH_RAW (
            sender   => 'Mailer',
            recipients => l_data(i),
            subject   => 'Data for ' || TO_CHAR((SYSDATE-1),'DD-MON-YYYY'),
            attachment => l_file,
            message   => :f,-- this is message item.
            att_inline => FALSE,
            att_filename => :filename);--this is attachment file name.
           l_start := l_start + 1;
      END LOOP;
      message('File Send Successfully');
      message('File Send Successfully ');
    END;hope this helps you.
    Attachment and mail are working fine with me, i can send attachment..............
    sarah

  • FRM-40735: WHEN-BUTTON-PRESSED raised unhandled exception INVALID_NUMBER

    Hi I get the FRM-40735: WHEN-BUTTON-PRESSED raised unhandled exception INVALID_NUMBER error message for block that has duplicate records.
    It works where the block returns no duplicate records.
    I'm guessing the error occurs because more than one duplicate records exists. How can I handle this?
    Below is the function that I'm using to check for duplicate values:
    FUNCTION find_dup (card_in IN varchar2)
    RETURN BOOLEAN IS
    get_card number;
    BEGIN
    select card_no into get_card from strike.member where
    prop_no = :member.prop_no
    and card_no in (select card_no from strike.member
    where prop_no = :member.prop_no
    having count(*) >1 group by card_no);
    RETURN TRUE;
    end if;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    RETURN FALSE;
    END;
    Below is the trigger used where a check is made for duplicate records before proceeding.
    WHEN-BUTTON-PRESSED trigger has below:
    if find_dup(:member.card_no) then -- guessing it finds more than one card_no value. Help how can I handle this?
    go_block('dup_member');
    execute_query;
    :global.dup_delete := 'Y';
    go_item('dup_member.prop_no');
    else
    message(' No Duplicate Records To View!');
    bell;
    go_block('member');
    hide_view('dup_canvas');
    raise form_trigger_failure;
    end if;
    Edited by: user648524 on Oct 27, 2008 1:33 PM

    It looks to me like strike.member.card_no may not actually be a number, and you are trying to select it into get_card.
    Try changing your get_card definition to:
    get_card    strike.member.card_no%type;

  • GO-ITEM  - WHEN-BUTTON-PRESSED - SQLAP-10048 - You have not selected a record.

    Hi,
    I need to use go-item -> execute-trigger(when-button-pressed) personalization in oracle EBS Payables module. However i face certain problem.
    When i do 'go-item' to particular 'button', row selection disappear(its a multi row block). In the result i receive an error - 10048 - you have not selected a record.
    Manually you just click a button with row selected, and everything goes fine. There must be some kind of a context parameter which is passed from a block/record/row to a button. However how to achieve this through personalization?
    Many thanks for every help.
    Best regards,
    Martin

    write a procedure in forms that disables all your items in that record and call this on When-New-Record-Instance and When-Button-Pressed.
    PROCEDURE disable_item IS
    BEGIN
    IF :<block>.indicator = 'X'
    THEN
    SET_ITEM_INSTANCE_PROPERTY('<block>.<item>, CURRENT_RECORD, INSERT_ALLOWED, PROPERTY_FALSE);
    SET_ITEM_INSTANCE_PROPERTY('<block>.<item>, CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
    .. (repeate this t2o Statemnts for every item,
    more elegantliy you may write a loop using built-in NEXT_ITEM to get all items and set insert and update off) ...
    END IF;
    END;
    On When-Button-Pressed set the value of :block.indicator to 'X' before calling the disable_item procedure.
    Attemtion: This solution assumes that the button is part of your MR block (cited bove as <block>).
    ... and code is just written down, not tested.

  • Raise Form_Trigger_Failure on When-Button-Pressed  ORA-01410 Invalid RowID

    Hello to all...
    I have an error whit Raise Form_Trigger_Failure on trigger When-Button-Pressed.
    I guess the error is when does the Raise Form_Trigger_Failure
    When validate something, this validation ask me if i want to continue.
    When i answer NO, give me this error: ORA-01410 Invalid RowID
    If i answer YES, the process continue and in an unexpected moment, give that error too
    Why give me that error?
    How can i resolve this error...help me
    thanks...
    Part of Code
    FOR i IN 1..TItemsAsi1.LAST LOOP
    IF TItemsAsi1(i).c_error IS NOT NULL THEN
    l_error := l_error + 1;
    IF TItemsAsi1(i).c_error = 'ND' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','No hay datos suficientes para generar Asiento de cierre relacionado a Reconocimiento de los recursos del ejercicio') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     ELSIF TItemsAsi1(i).c_error = 'AD' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','Hay cuentas Acreedoras con saldo Deudor CUENTA: '||TItemsAsi1(i).c_cuenta||'. ¿Desea continuar con el cierre? ') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     ELSIF TItemsAsi1(i).c_error = 'DA' THEN
    IF NOT Fpa_mensaje.disp_consulta_sino('Atención','Hay cuentas Deudoras con saldo Acreedor CUENTA:'||TItemsAsi1(i).c_cuenta||'. ¿Desea continuar con el cierre? ') THEN           
    RAISE FORM_TRIGGER_FAILURE;
    END IF ;     END IF;END IF;END LOOP;

    delete from <table> where rowid like '<block id>%'Arrgh. To be honest, this is the worst sql-statement i have seen this year. i hope the statement will raise an error on execution, but even if it would get executed, what should be the reason for something like this? Delete anything which is stored in a specific block, regardless of the meaning ?

  • FORM 9i when-button-pressed trigger

    I am working on a form that has "Enter Query" and "Exe Query" buttons. In the when-button-pressed trigger associated with "Enter Query" button, I put:
    enter_query;
    In the when-button-pressed trigger associated with "Exe Query" button, I put:
    execute_query;
    (If I put "execute_query;" in when-mouse-clicked trigger it works, but I am kind of certain that there got to be a way to do it with when-button-pressed trigger.)
    The "Enter Query" button works as desired. However, the "Exe Query" button does not work. In fact, all the other buttons do not work unless, I press F8 to execute the query.
    I noticed the problem is the system.mode is changed to enter_query.
    Please give me some clues how to deal with it.
    Thank you.

    Thank you Frank and Dennis.
    I realized the problem is that when system.mode in enter_query. The navigation is restricted to the data block. I then moved all the relevant button into the data block. I have not yet tried what Dennis suggested: set mouse navigation to NO.
    Thank you.
    Jimmy

  • When-button-pressed trigger save two records ?

    Hi all,
    I'm very new to Oracle form. I intend to make a very simple form where will allow user to enter and save record when finished.
    There I have build up the form and one push button where will called the when-button-presses when the user click.
    I have write the query as below :-
    begin
         if :device is null then
              message('Device no is null!!');
              raise form_trigger_failure;
         else
              insert into aic_std_cost_sell_price values ( :device, :asm_price, :tst_price);
              commit;
         end if;
    end;          
    however when save, two record had been inserted? and why ?
    rgds
    Lim

    When you create a block based on a database table, Forms builds and executes a SQL insert statement for you when you issue a commit statement. Therefore, yours is running, then Forms builds and executes one.
    Remove your insert statement. You don't need it.
    And change the COMMIT; to COMMIT_FORM; They do the same thing, but using commit_form will help you remember that lots of things are going on behind the scenes when you use it.

  • WHEN BUTTON PRESSED TRIGGER

    Hi,
    I've created a form with 4 data blocks (each of which has its' own canvas, items, and window). On my first canvas, I've created "push buttons" for the user to select which canvas (block/window) they go to next. I've attached WHEN-BUTTON-PRESSED triggers to each of these buttons (which execute a go_block command), however, when I first run the form and click on a button, nothing happens. If I execute a query BEFORE I click on a button, they all work fine and take me to the correct canvas. Could someone please tell me how I can get these buttons to work WITHOUT having to execute a query first? I've looked at all the property palettes, etc. and can't see any attribute that I can set.....any help would be greatly appreciated. Thank you. (I'm using Forms 9.0.4.0.19)

    Thank you so much for your responses. I had changed the
    Fire In Enter-Query Mode to No, but that didn't help, however, changing the trigger from WHEN-BUTTON-PRESSED to WHEN-MOUSE-CLICK did the trick - it works fine.
    Can you suggest a good reference for determining which type of trigger you should use?
    Thanks again for your responses - I really appreciate it!

  • How do I execute a 'remote' when-button-pressed trigger?

    I am using Forms 6 in an 8i/10g environment. I have a data block (COMPACT) which is on canvas MAIN. Compact has an item (button) called CREATE_COMPACT, with a when-button-pressed trigger. I also have an error canvas which has a button called RESTART, so they can restart the entire build after an error. The restart code is exactly the same as the create_compact code, and, after the restart, I want the focus to be the main canvas, so I would like to just have the restart when-button-pressed trigger shift focus to the CREATE_COMPACT trigger and execute it. I have tried:
    go_item( 'Compact.Create_Compact' );
    do_key( 'Enter' );
    This switched me to CREATE_COMPACT but did not execute the trigger. I then tried:
    execute_trigger( 'Compact.Create_Compact' );
    and then:
    execute_trigger( 'Create_Compact' );
    but neither of these work. I get error FRM-40700 no such trigger. Is there any way to do this short of copying code or creating a pl/sql procedure?
    thanks

    do_key('ENTER') will execute the code in a KEY-ENTER trigger so I suggest you move your code into the KEY-ENTER trigger. On your when-button-pressed trigger you should also use do_key('ENTER');

  • Calling a report from forms - FRM-40735 when-button-pressed raised unhandle

    Hi,
    I created a form to generate a pdf report.
    its not going too well, so i need some help.
    my form only has one button , when pressed I want it to generate a report in pdf format.
    i created a when-button-pressed trigger and the following code is below:
    I also create a web service proxy jar file,
    the jar file is in the FORMS_BUILDER_CLASSPATH, and the jar file is imported from forms builder without any issues.
    As of now I am hard coding everything in the code below to see if it works.
    The error I am getting  FRM-40735 when-button-pressed raised unhandled exception ORA-105100 i dont know why ?
    This error is occurring at this line of code, please help, this is my first time doing something like this.
    obj := publicreportserviceclient.new(); DECLARE
    param_name varchar2(200);
    un varchar2(200);
    pw varchar2(200);
    out_file varchar2(200);
    obj ORA_JAVA.JOBJECT;
    BEGIN
    obj := publicreportserviceclient.new();
    param_name := 'EMP';
    un := 'Administrator';
    pw := 'Oracle123';
    out_file := 'D:\DevSuiteHome_1\j2ee\home\default-web-app'||'output';
    publicreportserviceclient.callRunReport(obj,'/~administrator/Learn/Test1/Test1.xdo','EMP','141414',un,
    pw,'pdf','New_Template',out_file);
    web.show_document('http://jmenge-de.de.oracle.com:8889/j2ee/' || 'output');
    exception
      --check for ORA-105101
      when ORA_JAVA.EXCEPTION_THROWN then
         message('Java Exception : '
          || Exception_.toString(ORA_JAVA.LAST_EXCEPTION));
          ORA_JAVA.CLEAR_EXCEPTION;
          return;
      --check for ORA-105100
      when ORA_JAVA.JAVA_ERROR then
                   message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
              return;
    END;This is my java function
        public void callRunReport (String reportPath, String paramName, String  paramValue, String
        username, String password, String format, String template, String outFile) {
        try {
                bip_webservice.proxy.PublicReportServiceClient myPort = new bip_webservice.proxy.PublicReportServiceClient();
                // Calling runReport
                ReportRequest repRequest = new ReportRequest();
                repRequest.setReportAbsolutePath(reportPath);
                repRequest.setAttributeTemplate(template);
                repRequest.setAttributeFormat(format);
                repRequest.setAttributeLocale("en-US");
                repRequest.setSizeOfDataChunkDownload(-1);
               ParamNameValue[] paramNameValue = new ParamNameValue[1];
                paramNameValue[0] = new ParamNameValue();
                paramNameValue[0].setName(paramName);
                String[] values = new String[1];
                values[0] = paramValue;
                paramNameValue[0].setValues(values);
                repRequest.setParameterNameValues(paramNameValue);
                ReportResponse repResponse = new ReportResponse();
                repResponse = myPort.runReport(repRequest,username,password);
                byte[] baReport = repResponse.getReportBytes();
                FileOutputStream fio = new FileOutputStream(outFile);
                fio.write(baReport);
                fio.close();
            } catch (Exception ex) {
                        ex.printStackTrace();
        }Thanks - please help

    If there is a way to make it work with Bi publisher, Please let me know.
    I need to something to make it work with BI publisher.
    thanks,
    Edited by: Rooney on May 27, 2010 1:27 PM

  • How can I call my chart in Forms6i on When Button Press Trigger?

    Hi Friends,
    I have make a chart in Graphic Builder 6i and save on path C:\graph\test.ogd
    Now I want to run this Chart from Form6i on When Button Press trigger.
    I have call my report in forms using this command on When Button Press trigger.
    Run_Product(reports,'C:\Cheema\Qdir_store\reports\pmms\sec_backlog',asynchronous,runtime,filesystem,TO_CHAR(NULL));
    So tell me How can I call my chart in Forms6i?
    Please reply me on urgent.
    Thanks,
    Shahzad

    Just to recall after a long break of couple of years..... Pls check out if not wrong.
    First of all you need to embeed the chart object on your layout window and make it visible = FALSE. This is a design time work. In the button press event, show the chart object by setting the visible property = TRUE.
    Note, i could not paste u the sample code as i don't have forms installation on my PC. The above states is a logic you can apply.

  • Looping through a table Help needed ....Forms 10g..... When Button Pressed

    Hye craig, hamid, christian and all ...........
    i have a user access interface which i create where there are two fields username and password and a button,
    i have also created a table USERS for users which have username and password fields ..... On useraccess interface i coded on WHEN BUTTON PRESSED like this
    declare
    go_block('users');
    execute_query;
    declare
    begin
         if :useraccess.username=:users.username and
              :useraccess.password=:users.password then
              go_block('MAINPAGE');
              else
              go_block('USERACCESS');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              end if;
    end;
    This code works for a single user in USERS table but for multiple users there has to be some looping system
    which matches the USERACCESS and USERS tables fields thoroughly ....

    Hi Majid,
    I can suggest you a workaround for this. raise a ON-LOGON trigger and you can use the LOGON_SCREEN builtin to flash the logon screen at runtime. And then try capturing the username and password.
    DECLARE
      connected BOOLEAN := FALSE;
      tries     NUMBER  := 3;
      un        VARCHAR2(30);
      pw        VARCHAR2(30);
      cs        VARCHAR2(30);
    BEGIN
      SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
      WHILE connected = FALSE and tries > 0
      LOOP
        LOGON_SCREEN;
        un := GET_APPLICATION_PROPERTY( USERNAME );
        pw := GET_APPLICATION_PROPERTY( PASSWORD );
        cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );
        LOGON( un, pw || '@' || cs, FALSE );
        IF FORM_SUCCESS
        THEN
          connected := TRUE ;
        END IF;
        tries := tries - 1;
      END LOOP;
      IF NOT CONNECTED THEN
        MESSAGE('Too many tries!');
        RAISE FORM_TRIGGER_FAILURE ;
      END IF;
    END ;   a sample piece of coding to help you out.
    Regards,
    Manoj Chakravarthy

  • Calling a function in WHEN-BUTTON-PRESSED

    Hello,
    i have in when-button-pressed a line containing
    select pachet_salarizare.ani_vechime(data_min, to_number(to_char(sysdate,'YYYY')), to_number(to_char(sysdate,'MM'))) into ani_vechime from dual;so i call a function which is in pachet_salarizare package (package created in program units, in Forms).
    when compiling, i get: function 'PACHET_SALARIZARE.ANI_VECHIME' mai not be user in SQL.
    how can i deal with this? i need the result of that function in a variabie, ani_vechime.
    Thanks!

    Uh, thank you. i thought it's not possible what i wanted..
    but strange why cannot be called function in select statements
    Regards,

Maybe you are looking for

  • IPhoto opens older pictures but not newer ones?

    Can someone possibly help me with my problem. Somehow I've ended up with two iphoto applications. I don't know how this happened b/c I always thought I just had one iphoto application. In any event, out of the blue on Sunday when I clicked my iphoto

  • My ipod wont charge , what do i do ? it isnt my cord either

    my ipod wont charge , what do i do ? it isnt my cord either

  • Select list with submit using on a dynamic report

    Hi! I'd like to know how can I create a Select list with Submit using the HTMLDB_ITEM API. I know there's an API named HTMLDB_ITEM.SELECT_LIST_FROM_LOV(), but I'd like to know how can I reproduce in there the submit everytime the user changes a value

  • IPOD songs blank- Still listen but no info shows up

    I haven't seen this addressed but I am sorry if this is a repeat question: I just got my Ipod video and it was working fine till last night. I didn't drop it, but now when I go to any song through either playlist, artist, album, genre, whatever, it p

  • Memory full error with printing pdf

    Occasionally I get a memory full error with printing pdf (Cmd-P - then use save PDF on lower left dialog screen). This is when just printing a few pages. Why Am I getting this and how can I fix this?