Domino Code Fragment

Code Name*
Web Counter using Profile Document
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.146.152.99
Description*
@function interfaces so that you can avoid using up the agent process. A computed-for-display field with the following formula will act as a counter for notes and web access with a timestamp and keeping the counter by document id fields within a single profile document:
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

profilename := "Page Usage Count";
docid := @Text(@DocumentUniqueID);
timestamp := @Now;
count := @GetProfileField(profilename; "Count"+docid);
@If(count=""; @Do(@Set("count";1); @SetProfileField(profilename; "TimeStamp"+docid; timestamp));
@Do(@Set("timestamp";@GetProfileField(profilename; "TimeStamp"+docid)); @Set("count"; count+1)));
@SetProfileField(profilename; "Count"+docid; count);
"This page has been accessed " + @Text(count) + " times since " + @Text(timestamp; "D0T1S2")