June 1, 200520 yr I would like to show the currently-logged on user account name on the screen to my users so they know whose session they might sit down in front of. Any idea what script to call on for this?
June 1, 200520 yr Create an unstored calculation field with the contents: Get(AccountName) Place that field wherever you want to see it.
June 1, 200520 yr I've done a similar thing although differently. I created a table called "Session". In this table I have created a bunch of GLOBAL fields that store information gathered during the initial login. This information is valid for the duration of the user's session. One of the fields is called Account_Name and it is populated via a startup script with a simple: SetField(Session::Account_Name; Get(AccountName)) Then I display the global Session::Account_Name field whenever and wherever I need it.
June 1, 200520 yr I wonder if there are any advantages/disadvantages to using globals vs. unstored calcs. for this purpose?
June 1, 200520 yr I suppose that one could argue that with an unstored calculation it would be continually calculating the result as the user wanders around whereas the global is just storing the data. However, maybe the unstored calculation just keeps the same value (not continually recalculating) because nothing is changing other than the vantage point. Probably one method is more efficient than the other. I really don't know. Maybe some of the regulars would care to weigh-in.
June 1, 200520 yr I think the benefit of a global here over an unstored calc is that the global is applicable to the entire database, the unstored calc is calculated for each record. In a large database that could cause performance problems.
Create an account or sign in to comment