Habe das hier in meiner grabbelkiste gefunden
Sometimes it's nice to see just how many people have read documents in that Knowledge Datasbase that you've spent many days/weeks/years (delete as applicable) developing.
Here is a small formula that you can put into a document to store such information.
How it works:
Quite simply it creates a suite of profile documents for each document. Why? Well then you don't get any replication/save conflicts since the document is not changed in any way.
Each profile contains a count and timestamp value. The first is how many times it has been read, the second is when it was first read.
Personally, I place this field (along with others like Author, Creation Date, Last Modification, Age of document etc.)
into a subform called Document History on my master template. Now whenever I need such functionality in any database, it's instantly ready for use.
Code: Simply create a computed for display text field and insert the following:
profilename := "Document History Usage Count"+ @Text(@DocumentUniqueID);
timestamp := @Now;
count := @GetProfileField(profilename; "Count");
@If(@IsNewDoc | @IsDocBeingSaved;
@Do(@Set("count"; 0));
count=0;
@Do(@Set("count";1); @SetProfileField(profilename; "TimeStamp"; timestamp));
@Do(@Set("timestamp";@GetProfileField(profilename; "TimeStamp")); @Set("count"; count+1)));
@SetProfileField(profilename; "Count"; count);
"This Document has been accessed " + @Text(count) + " time(s) since " + @Text(timestamp; "D0T1S2")