If a process is running from the menu, that process has no concept of any user let alone a logged in user. When that process runs, there could be 0 users logged on ....
That doesn't make sense.
If a process is run from a Menu, the User that selected the menu Item is logged in... so there
must be a LoggedInSystemUser, which I was able to test for
When there was a user logged in, but not when there wasn't. (I'd forgotten about AccessLevel = 'System' )
So my logic was: that if a LoggedInSystemUser is in Context (or a Session Object) then the process must have been run by the the user from a Menu or Query, and
NOT run from the schedular. I needed a way to test when there was no user logged in.
Anyway, after getting it working with the...
Code: Select all
if LoggedInRegularUser.AccessLevel='System'
...method, I went back to using the non persisted Session Variable, that way I could run the process as an admin from a menu, and the system would think it was run by the schedular and behave as such.