3 Replies Latest reply on Aug 8, 2011 10:29 AM by François Degrelle

    ora-06508 when using webutil

    Martijnke
      Hi all,


      we keep getting this error when using webutil functions in when-new-record-instance
      everything works fine when putting the same code in a when-button-pressed :

      DECLARE
      l_ok boolean;
      BEGIN
           l_ok := webutil_file.file_exists('c:\temp\PST.txt');
           if l_ok then
                message('file found');
           else
                message('file NOT found');
           end if;
      END;

      the following code seems to be causing the ora-06508 in the when-custom-item-event :
      begin
      WEBUTIL_CORE.CustomEventHandler(:SYSTEM.CUSTOM_ITEM_EVENT,:SYSTEM.CUSTOM_ITEM_EVENT_PARAMETERS);
      end;




      Kr
      Martin
        • 1. Re: ora-06508 when using webutil
          François Degrelle
          Hello,

          Webutil requires Java Beans, and it is indicated that some function do not work in triggers that fire at startup like WHEN-NEW-... because the Bean has not been instanciated at this time.
          The common trick is to use a non repeating TIMER in the When-New-Form-Instance about 1/2 second, just to give time to Forms to instantiate the Java Beans located on the canvas.

          Francois
          • 2. Re: ora-06508 when using webutil
            Martijnke
            Hi Francois,


            I have read about that,
            in design time I can show the webutil_canvas, all beans show correctly

            when I put the code in a when-button-pressed it works ok, but not from when-new-record-instance
            so is this also a trigger where we can not use webutil ?
            is there a list somewhere of triggers in which webutil cannot be used ?

            I will implement the solution using timers

            Kr
            Martin
            • 3. Re: ora-06508 when using webutil
              François Degrelle
              Here is a (non exhaustive) list of triggers that can fire before the layout is graphically rendered:

              PRE-FORM
              WHEN-CREATE-RECORD
              PRE-BLOCK
              PRE-RECORD
              PRE-TEXT-ITEM
              WHEN-NEW-FORM-INSTANCE
              WHEN-NEW-BLOCK-INSTANCE
              WHEN-NEW-RECORD-INSTANCE
              WHEN-NEW-ITEM-INSTANCE

              Francois
              1 person found this helpful