User profile when logging in VLF1

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

User profile when logging in VLF1

Post by ESODevKJ »

Hi All,

Does anyone have a code example for capturing user, user_audit, etc. after logging in on the web? Our audit fields return DFTUSER even though our user profile field populates with the logged in user. My understanding is it has to be mapped to a persistentstring, but I can't quite figure it out.

Thank you!
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: User profile when logging in VLF1

Post by René Houba »

Hi,

Is this WAM's or VL Web?
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

Re: User profile when logging in VLF1

Post by ESODevKJ »

VL Web
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: User profile when logging in VLF1

Post by Dino »

Have you check the supplied reusable part VLFDEMO_ ? That one is a server module for VLF ONE that can do the setting of the USER_AUDIT with the user name sent to it in the initialize section:

Code: Select all

* For example, you might consider altering LANSA’s audit user here using the
* SET_SESSION_VALUE built-in function:
* Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT <<user name>>)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

Re: User profile when logging in VLF1

Post by ESODevKJ »

Hi Dino,

I have tried that and the user_audit field still comes back blank.
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: User profile when logging in VLF1

Post by Dino »

I remember I deal with this before.... found an old email:

All the steps were:
1) I took the common activity to create a framework access validator, which was named TEST06_LogonValidation, and used the user there to assign it to a Persistent String:
#Persistent_ApplicationString1 := #UserProfiletoCheck

2) In TEST06_ServerSystemManager, MthRoutine InitializeServiceRoutine, I uncommented the SET_SESSION_VALUE and used the same persistent string there:
Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)

3) I noticed that the server module generated by the common activities don’t have the persist command at the beginning. Need to have this, so I added it.
Persist Fields(#Persistent_ApplicationString1 #Persistent_ApplicationString2 #Persistent_ApplicationString3 #Persistent_ApplicationString4 #Persistent_ApplicationString5)

Please check that.
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

Re: User profile when logging in VLF1

Post by ESODevKJ »

Thanks Dino. That was it. Works as intended now.
Post Reply