ASNA Mobile RPG® Reference Manual

Customizing the Sign On Process

This topic details how to go about tailoring the Sign-On process to your specific project.

Modifying the Sign on Logic

The sign-on display file and logic provided with ASNA Mobile RPG may be functional for the programmer in a testing environment but it does not provide restricted access to the other servers that may not be available to all users, and it can be cumbersome for most daily users in a runtime environment. To eliminate both of these issues the sign on display and logic can be changed in a couple of ways.

Preload Variables and Display Only

One option is to set all of the variable values except for the user name and password in the MobileRPGJob.cs, .vr, or .vb code and change the Usage attribute in the SignOn.aspx for those variables that you preset to "OutputOnly". The MobileRPGJob.cs example is shown below setting the server, program, library, and port to specific values; and the user, password, menu, and message to spaces.

In practice, instead of a single program (Custinqcl in the example), a menu may be the starting program which the user works from throughout the day. In that case, set the menu name instead of the program name and set the Usage attribute to "OutputOnly" for both the program and menu.

MobileRPGJob.cs with variable settings shown


Next, you want to change the Signon.aspx to reflect a Usage attribute of "OutputOnly" for those variables that you preset in MobileRPGJob that you do not want the user to override, namely server, program, menu, library, and port. The following image shows the Usage attribute changed to "OutputOnly" for the server field.

SignOn.aspx shownwith usageequal outputonly


Preload Variable and Remove from the SignOn.aspx

In the above example, the user sign on still displays all of the sign on information but only the user name and password are entered. Under some circumstances you may want to display only the user name and password and hide the remaining fields that you preset with values.

Remove SignOn.aspx and Call your Sign On Program

There may be an instance where you already have your own sign on program that you want to use instead of the SignOn provided with the ASNA Mobile RPG Design Aid. If that is the case, you will need to do several things.

  1. Add the "Handler" keyword to the workstation file in your sign on RPG program on the IBM i and recompile it.
  2. Remove SignOn.aspx from the WebSite Solution.
    • In the Visual Studio Solution Explorer window, select SignOn.aspx. Right mouse click and select Delete from the dropdown menu. The file will be removed from the project.
  3. Remove all references to the Signon.aspx from the MobileRPGJob code and add the appropriate values to the MobileRPGJob code to call your IBM i server signon program.
    • Remove the LogonScreen region. Collapse the region, right mouse click, and select Cut from the dropdown menu.
    • Remove goMenu. Collapse the code section, right mouse click, and select Cut from the dropdown menu.
    • Remove CallQcmdExec. Collapse the code section, right mouse click, and select Cut from the dropdown menu.
  4. Change MobileRPGJob code to call your sign on program.