Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Log In/Log Out


DocD
 Share

Recommended Posts

There must be some reasonable solution for tracking who and when (and even how long one has been on) people log onto FM8...help is appreciated!

 

Thanks all!

 

DocD Oh Really!

Link to comment
Share on other sites

It's fairly easy to trap login times for a specific user and paste that into a field via scripts that run on startup/login.

 

Logout is harder unless you can disable the "close with X" option (for PC). I have built this into my QUIT button script, but if the user closes the application in other ways, it doesn't get captured.

 

$400 gets you a plug-in that eliminates closing with X. There's a workaround that essentially puts a script into endless pause until Quit is selected and this somehow prevents the "close with X" option from working. I've not tried this, it seems... uncertain.

Link to comment
Share on other sites

...well, what is it, how can I trap this information on log in? I mean if it is fairly simple can you outline it here for me?

 

I have no interest for a plug in for this, my solution closes with a flash screen so I assume I can create a script once I understand how. So...help please if you have it...

 

Thanks!

 

DocD Oh Really!

Link to comment
Share on other sites

Add a table to track the successful logins, and have your opening script (or login script,) add a record to this "Login Log" table. Something like:

 

#Script to add Login Log record for current account

Go to Layout [ Login Log ]

New Record/Request

Set Field [ Account Name ; get(AccountName) ]

Set Field [ Login TimeStamp ; get(CurrentHostTimeStamp) ]

Commit Records[]

Go to Layout [ original layout ]

 

 

If you wish to try to close out the log entry when the user logs out, then it may help to retain the record ID of the Login Log entry, so you can jump back to it. In this case you'd need a unique 'RecordID' field (an auto-enter serial number,) and a number field with global storage 'gLoginRecordID', and set it along with the others:

 

#Script to add Login Log record for current account

Go to Layout [ Login Log ]

New Record/Request

Set Field [ Account Name ; get(AccountName) ]

Set Field [ Login TimeStamp ; get(CurrentHostTimeStamp) ]

Set Field [ gLoginRecordID ; RecordID ]

Commit Records[]

Go to Layout [ original layout ]

 

 

Then for the logout, you'd need to use the 'gLoginRecordID' in a self-join relationship:

 

Login Log Login Log Self-Join =

Login Log::RecordID = Login Log Self-Join::gLoginRecordID

 

Now you can use that relationship to make sure that the Login Log record that was used at login is the record operated on for setting the logout info:

 

#Script to post logout time in active Login Log record

Go to Layout [ Login Log ]

If [ Login Log Self-Join::RecordID ]

#If a Login Log record exists

Go to Related Records [ From table: Login Log Self-Join, Using Layout: ]

Set Field [ Logout TimeStamp ; get(CurrentHostTimeStamp) ]

Commit Records[]

End If

Go to Layout [ original layout ]

 

 

Remember that the logout script could be skipped for a variety of reasons, so consider what problems you might have if there are some Login Log records with no 'Logout TimeStamp'.

 

I suppose you could have your navigation scripts frequently update a 'Last Activity TimeStamp' field in that Login Log table. This way, if the connection is broken or the user does a Force Quit, you could still get an idea for whether the session is still active, or how long it lasted.

Link to comment
Share on other sites

Ender,

 

Thanks for your help...

 

The log in works easily. For log out could I use;

 

-In 'File Options' select 'When closing this file' and add the following script?

-Go to Layout [Log inOut]

-Go to Record/Request/Page[Last]

-Set Field[Log Out Time;Get(CurrentTimeStamp)]?

 

Or, is there a way to utilize the new Get(nth Record) function?

 

Thanks...

 

Leoff

Link to comment
Share on other sites

That may work in a single user environment, but if multiple users create records in that table, then the last one may not be for the current user's session.

 

Actually, that script may work if you take out the Go to Record/Request/Page [ Last ] step. This would assume that the found set in the Login Log table never gets changed in the course of the user's activity. I thought you may allow users (even yourself) access to view or report on that data, so that's why I suggested using that RecordID to make sure you return to the right record before closing it out.

Link to comment
Share on other sites

...understood about the single user vs. multiple user environment. So far I haven't had any changes of significance, but will play with it more today with multiple users...

 

Thanks so much for your help and interest! Have you toyed with the 'Nth Funtion' much? Might that provide some value in this case...?

 

DocD

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use