Come creare un contatore di accessi per ogni documento

TIPS DEVELOPERS

  • 0 commenti
Per realizzare un contatore di accessi su ogni pagina o Form in Notes e Web esistono due possibilità:
  • @FORMULAS
Inserendo un campo di tipo "computed for display" :
********************************************************************

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);"A questa pagina hanno avuto accesso " + @Text(count) + " Fino Alle " + @Text(timestamp; "D0T1S2")


********************************************************************
  • Agente Lotus-script

********************************************************************
Sub Initialize
Dim Session As New NotesSession
Dim ProfileDoc As NotesDocument
Dim doc As NotesDocument
Dim num As Double
Dim NumStr As String

  Set db = Session.CurrentDatabase

 'The following line gets a handle to the current document
 Set doc = Session.DocumentContext

 'The following line creates a Profile document called 'Domino' the first time 'it is executed and from then on modifies the existing 'Domino' document
 Set ProfileDoc = db.GetProfileDocument("Domino")

  NumStr = ProfileDoc.num(0)
 If NumStr = "" Then
   num = 1
 Else
   num = Cdbl(NumStr) + 1
 End If

  ProfileDoc.num = Cstr(num)
 Call profiledoc.save(False,False)

  doc.Number = num

End Sub
********************************************************************

Questo agente verrà settato con l'opzione "Run at once" e salvato ad esempio come "counter"
Sulla Form dove si vuole rendere attivo il contatore creare un campo numerico chiamato "Number" ed aggiungere un campo "computed text" chiamato $$QueryOpenAgent. Come formula di questo campo mettere il nome dell'agente da richiamare ( nel ns. esempio "counter")



 

0 Commenti:

    Nessun Commento Trovato
Commenta articolo
 

Questo spazio web è stato creato da per un uso pubblico e gratuito. Qualsiasi tipo di collaborazione sarà ben accetta.
Per maggiori informazioni, scrivete a info@dominopoint.it

About Dominopoint
Social
Dominopoint social presence: