Page 1 of 1
Setting different initial pgms for different persons
Posted: Wed Apr 06, 2011 11:36 am
by chris_rover
hello, how can i configure different initial screens for different users? also, how do i set up the different user groups that the file pui0001202 seems to be asking for?
I wish to set up a startup screen for our mobile salesmen, and I do not wish for it to be the default for all other users.
Re: Setting different initial pgms for different persons
Posted: Wed Apr 06, 2011 11:54 am
by David
You'll want to use the "Maintain Initial Programs" dialog to do this. It's found under the Launch menu in the Visual Designer.
I would not reccomend manual editing of the file.
Groups are not yet implemented in Profound UI. The field is present in the file to allow for future expansion.
When using the Maintain Initial Programs dialog, there is a section at the top "Default Initial Program". This program will be called for any user signing in who does not have a user-specific record.
User-specific records are added below using the green '+' button. When a user signs in who has one of these records, the program specified there will be called instead of the default initial program.
So, you'll probably want to add user-specific records for all your mobile sales people that will override the default initial program used by everybody else.
If this system is not flexible enough for you, you are certainly not stuck with it.
For example, some customers have their own system of doing this where a single initila program is called for everybody (set default initial program and have no user-specific records).
That single point of entry can then decide in its own way where the user should go and call the appropriate program.
Re: Setting different initial pgms for different persons
Posted: Wed Apr 06, 2011 1:01 pm
by dcutter
I've set up an initial program for our sales staff using the way you described above with user-specific records. Right now the first screen they see (after logging in) has them select whether or not they want to display the mobile screens (designed for an iphone), or full size screens. I've designed the mobile screens & programs specifically for that purpose and the full size screens with much more information for a computer. I was wondering if there is a way to automatically determine if they are signing in from an iPhone vs. signing in from a computer so they don't have to select which screens to display?
Re: Setting different initial pgms for different persons
Posted: Wed Apr 06, 2011 1:22 pm
by David
You can do this with JavaScript code by parsing the "user agent" string that the browser sends to the server.
There is a great article on how to do that here:
http://www.hand-interactive.com/resourc ... script.htm
You might consider calling a script "onload" from your initial screen to do the check. Based on the type of browser detected, it could make the selection for the user automatically by automating a button click or by setting a hidden field and pressing enter.
In a future release, we may consider setting the user agent string to an environment variable in the application's job so that the detection could be done on the server-side. That is not possible today since the application job has no way to get the user agent string as it stands.
Re: Setting different initial pgms for different persons
Posted: Wed Apr 06, 2011 2:35 pm
by David
In our next update (2.3.0), the user agent string will be available to the RPG application in environment variable HTTP_USER_AGENT.
An RPG application could retrieve this using the getenv() system API (see IBM docs). You could then parse the string the same way the JavaScript examples do in the above article to perform the detection on the server-side.