2 Replies Latest reply: Jan 7, 2013 1:46 PM by Louis RSS

    Forms 11g LOGON_SCREEN=YES

    Ady Keeling
      In Forms 10g you could set the userid parameter to something like "@TEST LOGON_SCREEN=YES" in a seperate config section in order to have the database name populated in the logon screen that a user is presented with.

      I can't seem to get this to work in 11g, does anybody know how it can be achieved?
        • 1. Re: Forms 11g LOGON_SCREEN=YES
          Ady Keeling
          I'll answer my own question here, I got round this by doing the following in our menu form, if you haven't got a single menu form then you may need to do this in all your forms where the user isn't already logged on when the form opens.

          right first off an on-logon trigger is required, I used the following:

          on-logon trigger


          DECLARE
               cn VARCHAR2(80);
          BEGIN
          /*
          ** Get the connection info
          ** If userid paramater in formsweb.cfg is set to '@<database>' or
          ** '@<database> login_screen=true' then this will put <database> into database field
          ** in default logon form
          */
               cn := Get_application_property(CONNECT_STRING);
               if instr(cn,' ') > 0
                    then
                    cn := substr(cn,1,instr(cn,' ')-1);
                    end if;

               LOGON(null,'@'||cn,TRUE);
               if form_success
                    then :global.login_success := 'TRUE';
               end if;
          END;

          Also, to deal with the situation where a user decides to click cancel in the logon screen, you need to put the following at the start of your wnfi trigger.

          when-new-forms-instance trigger

          default_value('FALSE','global.login_success');
          if :global.login_success != 'TRUE'
          then
          erase('global.login_success');
               exit_form;
          end if;
          erase('global.login_success');
          • 2. Re: Forms 11g LOGON_SCREEN=YES
            Louis
            The easiest is to modify the config section in formsweb.cfg by adding following lines to the specific application section:
            [mytestsection]

            ...
            userid=@orcl
            otherparams=logon_screen=yes
            ...