Skip to main content
Question

Record who presses a URL Button

  • August 19, 2020
  • 0 replies
  • 47 views

Forum|alt.badge.img+1
Hi,

We are using QB as a Knowledge Hub, uploading documents from our various projects and programmes.  The documents are our companies IP.

Accordingly we want to be able to track who is downloading the documents as we do occassionally give access to contractors.

To cover off on access restrictions we don't display the file attachment in records or reports for general users.  I have a URL Button that tests that a <Restricted Access> checkbox is not ticked, and that a document actually exists.  If these two criteria are met, the button appears and is able to be pressed which downloads the document.

Code for the button is here:

If([Restricted Access]=false,If(ToText([Attachment])<>"",
URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e6/v0"))

What I would like to be able to do is each time the button is pressed, record the user pressing the button in a log field.  Date and time would be a bonus, but could live with just user name.   
Basically just need to copy Current User and potentially date to a text field, that has the <log> button ticked!

Any help greatly appreciated in how we add this to the URL if it is even possible at all.

Cheers


 




------------------------------
Gerome
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
It would be better to have a child table to log who viewed the file as the logged field could get to be very long, but try this.  I am using formula variables to break up the formula into smaller pieces.


var text Log = URLRoot() & "db/" & Dbid() &  "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_99=Viewed"; // replace 99 with the logged field with logging the time enabled..

var text ViewFile = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e6/v0";

var text LogAndView =
$Log
& "&rdr=" & URLEncode($ViewFile);


If([Restricted Access]=false and ToText([Attachment])<>"",
$LogAndView)

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------