02-01-2011 07:59 AM
I would like to get more utility out of the API functions AmGetUserEnvSessionItem() and
AmSetUserEnvSessionItem(). I discovered these by chance in the ProgRef manual and started
using them to allow wizards to inter communicate. I know of no other way for a called wizard
to pass data back to its caller (this used to be possible in days of yore).
I would like to know if this is a bullet proof mechanism that will always be available. I also have
a few questions regarding use of this method:
Where is the data stored when executing AmSetUserEnvSessionItem? It appears to just be out there
somewhere. How persistent is this data structure? If the process that Sets it dies, is it still
Is this data structure cordoned off within the user session space? In other words it two user both
use the same wizard which calls AmSetUserEnvSessionItem are these data structures held seperately
for each user session? The function names indicates that they are but I would like to know for sure.
I would be interested in knowing how you all feel about using these two functions in everyday use. I
have used them extensively in a large development environment but I always had a nagging feeling of
uncertainty as they are virtually undocumented and I am not sure for what use they were intended.
02-07-2011 10:56 AM
These two functions AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem() were originally created mainly to be used by the developers within AM. Therefore from an end user point of view, there is really no specific use for them.
That being said, to answer your questions:
Is this a bullet proof mechanism that will always be available?
Like any other exposed API, these functions follow the same rules. For now there is no reason for them to just disappear.
Where is the data stored?
It is stored as a record in the amSysConfig table.
How persistent is this data structure?
Since it is stored in amSysConfig table, the information is persistent between user sessions.
If two users both use the same wizard which calls AmSetUserEnvSessionItem() are these data structures held separately for each user session?
Yes, the record is user dependent. The record in amSysConfig will have an ‘lEmplDeptId’ value equal to the user Id who generated the call of AmSetUserEnvSessionItem().
One usage you could get out of these functions for instance would be a Wizard that would have an additional page (or pages) the first time a user is running this Wizard.
Let me know if you have other questions.