(RDMLX) How can I get the logon user

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
cklee
Posts: 13
Joined: Fri Feb 08, 2013 7:05 pm

(RDMLX) How can I get the logon user

Post by cklee »

I have used the shipped component LRUAVAIL and LRULOGON to request user logon to use LongRange. I would like to get the logon user within my form. Anyone knows how to do that? I would also like to ask what's the use of the 'User Profile' within the IBM i Settings in a server profile definition? Many thanks.
MarkDuignan
Posts: 346
Joined: Wed Apr 18, 2012 10:33 am

(RDMLX) Re: How can I get the logon user

Post by MarkDuignan »

The "IBM I User Profile" you can enter in settings is used in two contexts:
(1). By all LongRange for RPG Apps
(2), For LongReach server connections (eg: when you use document views).
The only use of the IBM i user profile in LongRange for LANSA is situation (2).

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

LRULOGON should not be used ‘as is’ in your project - otherwise you will lose your changes the next time you upgrade - or the upgraded LRULOGON may have new or changed behaviors that you do not expect – so copy it to make your own custom version.

In your custom version of LRULOGON save the logged on user name somewhere. Do this the same way that you use for remembering other program values between user interactions. Then other form views can then extract this value when they execute.

If you do not have a generic way to remember values you can use the shared state methods - http://www.longrangemobile.com/docs/lan ... ethods.htm

Also see this thread about using shared states - it’s for LongRange for RPG but exactly the same ideas and cautions apply http://longrange.lansa.com.au/viewtopic ... state#p341

If you want to encrypt the user name, or any shared state variable, use the standard LANSA built-in functions.
Post Reply