Capture Date/Time Stamp and User ID when a link is clicked

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

Good Morning QB Gurus ... boss has asked if QB can do something ... I know it can, just don't know how to do it. Make me a hero today!


I have a URL field that links to external websites. The specific URL data resides in a parent table - the URL is added by the administrator. The User accesses the URL field in the child table.

Each time the User clicks on the URL link I need to be able to capture the following:

1.) User Name 

2.) Date

3.) Time

I'd like to be able to generate a report of the data and would like to not only keep the last time a link was clicked, but the history over time.

Possible? 

Photo of Andrew

Andrew

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 64,364 Points 50k badge 2x thumb
I will try to describe this, but this code is obviously not tested.

Set up a child table to the URL table called URL Access Logging

Create a URL formula field called [Log and link to URL] from where ever the user launches from. 

var text CreateLog = URLroot() & "db/" & [_DBID_URL_ACCESS_LOGGING]

& "?act=API_AddRecord&_fid_xx=" & totext([Record ID# of the URL Parent record]);

var text LinkToURL = [URL];

$CreateLog

& "&rdr=" & URLEncode([URL])

The xx in the formula above will be the field in the logging table for [Related URL]

So let's get that working first and then I can show you how to make that link appear as the clickable URL itself.  Initially this will be a separate button from the URL.



We will automatically Capture the User and the date/time since that will be the record owner of the log record and the date / time created.