How to create auto incrementing number

How to create auto incrementing number? Please anyone help me.

Subject: in Notes FAQ

Subject: How to create auto incrementing number

Hi, Its Very Simple. U Create a View Which Will Store a value “1”.

and write a agent which will take the value from the view (Colum) and Update the value and save it in same location.

Like That

=================================

Dim s As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim doc, docv,uDoc ,docv1 As NotesDocument

Dim num As Variant

Dim n ,mail As Variant

Dim nd As String

Set db = s.CurrentDatabase

Set uDoc = s.DocumentContext

Call uDoc.save(True,True)

Set view = db.GetView(“Vserialnumber”)

Set docv = view.GetFirstdocument

If Not docv Is Nothing Then

n = docv.GetItemValue(“MSNO”)

num =Cint(n(0))+1

uDoc.CompNo=n

docv.MSNO=num

Call docv.save(True,True)

Call uDoc.save(True,True)

End If

===================================

Pawan Kumar