Document Hit Count - Users no Edit Access

I am attempting to set up a form with a number field used to keep track of the number of times the document is opened. I placed a number field called Count on the form in question and added a @SetField command to the QueryOpen event to increment the Count field. The problem is not all users have edit access in the database thus when it hits the QueryOpen event it dies. Is there another means to keep track of hit counts in Notes with users having only Read access???

Thank you ahead of time for any suggestions!!

Subject: Document Hit Count - Users no Edit Access

I do it by storing a second document which just contains the counter field and the docid of the document it’s tracking. If you make this counter doc “Available for Public access” and give your readers “Write Public Documents” access then your QueryOpen can update the counter doc without having to edit the main doc. This will also get round the problem of save conflicts on your main document.

Subject: RE: Document Hit Count - Users no Edit Access

Ok, I created a second form called Count that is a public access form. When the main form is closed (QueryClose) it checks to see if there is already a reference document Count. If there is then it just ups the count. If there isn’t it creates a new Count response form and sets the count to 1. This works a’ok for me, but still a user wither Reader access gets and access message by simply opening and closing the document. Am I missing something here?

Subject: RE: Document Hit Count - Users no Edit Access

Check the following:

  1. Readers must have Write Public Socuments access (checkbox in ACL)

  2. Counter form must be marked as “Available for Public Access Users” (Checkbox in form properties security tab)

  3. Counter form must have a field called $PublicAccess with a value of “1”. Best to set this as Computed and do a computewithform through script when the counter document is first created.

Good luck!

Pete

Subject: Document Hit Count - Users no Edit Access

You don’t need to edit the document, but you can make a seperate database/view where you keep the counter documents, which are editable by everyone. Those documents could be sorted in a view with @Text(RefDocID), where RefDocID is the document universal ID of the document for which you want the counter. In the real document, you just show the value of the counter of the counter document. This way you would also avoid replication conflicts, if your database is clustered or replicated around multiple servers - the users would always access the counter documents on the same server.

Another approach would be to get rid of the Notes Client, and use the database from the Web, then you can have a WebQueryOpen agent which is run by the server, which has always editor access to the documents.

Subject: RE: Document Hit Count - Users no Edit Access

Sounds like we’re thinking the same way… :wink:

Subject: RE: Document Hit Count - Users no Edit Access

Hehe, yeah, then it must be a good solution :slight_smile:

Subject: Document Hit Count - Users no Edit Access

Try this,

Create a form (‘HitCounter’) with these two fields

DOCID and counter

In the QueryOpen of the Form to be tracked search for the HitCounter with the DocID, if found increment counter else create new HitCounter doc for the document.

To display the counter

in the Target form set a Computed for display field with Lookup formula to this Hitcounter Document with DOCID as lookup key.

Have just thought it up Have not tested it.

OfCourse this form can be in another db too.