oracleforms

ORACLE Forms 12c WEBUTI_HOST call at WHEN-NEW-FORM-INSTANCE


I'd like to retrieve client information when initializing an Oracle Forms application. When I use WEBUTIL_HOST.Blocking('whoami') within the WHEN-NEW-FORM-INSTANCE trigger, I encounter the following error:

oracle.forms.webutil.host.Host bean not found. WEBUTIL HOST. Execute will not work.

However, if I call the same function later, for instance in the WHEN-TAB-PAGE-CHANGED trigger, it functions correctly. What would be the appropriate approach to achieve this after the application has started?


Solution

  • I have found the solution here.

    You have to do it with a timer. As soon as the form is initialized, the timer will fire. In the trigger WHEN-TIMER-EXPIRED you can call the WEBUTIL_HOST.Blocking('whoami').

    So the code looks like that:

    In the trigger WHEN-NEW-FORM-INSTANCE you need to create a timer, which fires 100 ms after the form is initialized and will not repeat.

    declare
      timer timer;
    begin
      timer := create_timer('webutil', 100, no_repeat);
    end;
    

    The WEBUTIL_HOST.Blocking('whoami') call goes to WHEN-TIMER-EXPIRED.

    declare
      process  WEBUTIL_HOST.PROCESS_ID;
    begin
      process := WEBUTIL_HOST.Blocking('whoami');
    end;