I have a database reservation, i have a problem with my chrono number because it is a chrono generated for each user or i would like to have a chrono general for all users , the problem appears because the users don’t see the reservation of other users, so it is a chrono by user … … and there are some double …
This is the code .
Can you modify this to have a chono general for all users, it is refer to view specific Numéro de chrono… i hope you are understand me , if you want i can send you the database to see my problem.
Can you help me , it is urgent
ThanKs for us .
Sub Initialize
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Dim source As NotesUIDocument
Dim doc As NotesDocument
'permet de récupérer la valeur d’un champ sur un doc
Dim item As NotesItem
Dim compteur As Long
compteur = 0
Set source = workspace.CurrentDocument
Set db = session.CurrentDatabase
ID = source.FieldGetText("NumID")
'On regarde la vue “Numéro de chrono”
Set view = db.GetView("Numéro de chrono")
Set vc = view.AllEntries
If vc.count=0 Then
'Nombre de départ du compteur
compteur="0000"
Else
'On cherche le dernier doc de la vue “Numéro chrono” et on récupère son compteur
Set doc = view.getFirstDocument()
unid$ = doc.UniversalID
If unid$=ID Then
Set doc = view.getNextDocument(doc)
End If
Set item = doc.GetFirstItem("ID")
Forall n In item.Values
it = n
Print n
End Forall
'Si l’item est égal à 0, alors, incrémenté le compteur et regarder le prédécesseur
While it="0000"
compteur=compteur+1
Set doc = view.getNextDocument(doc)
Set item = doc.GetFirstItem("ID")
Forall n In item.Values
it = n
Print n
End Forall
Wend
'compteur = compteur+Cint(it)
compteur = compteur+ (it)
End If
'On assigne la valeur compteur au champ ID
'Call source.FieldSetText("ID",Cstr(compteur+1))
Call source.FieldSetText("ID", Format$(Cstr(compteur+1),"0000"))
Call source.save