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.commark.shnier@gmail.com
------------------------------