Form contains a computedtext which get seq num, but suddenly if i create new doc it is getting seq num as NULL. I tried all the options but only which i found is if i delete all the null contain doc new doc is getting next genaration num but i dont want to delete the doc becoz there are huge no of null docs now. Any Idea how to solve this prob
Function SeqNumGeneration(SearchKey As String, DocType As String)As String
On Error Goto errorhand
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim SeqVw As NotesView
Dim vwEntry As NotesViewEntry
Dim seqDoc As NotesDocument
Set db = ses.CurrentDatabase
If DocType = “Procedure” Then
Set SeqVw = db.GetView(“SeqNumProc”)
End If
If DocType = “Policy” Then
Set SeqVw = db.GetView(“SeqNumPolc”)
End If
Call SeqVw.Refresh
If Not(SeqVw Is Nothing) Then
Set vwEntry = SeqVw.GetEntryByKey(SearchKey)
If Not(vwEntry Is Nothing) Then
Set seqDoc = vwEntry.Document
If Not(seqDoc Is Nothing) Then
'Here i am getting strSeqNum “NULL” so the new doc seq no is going to be null
strSeqNum = seqDoc.SeqNum(0)
'If Len(Trim(strSeqNum)) = 0 Then
'strSeqNum = “NULL”
'Msgbox strSeqNum
'Else
strSeqNum = Cint(strSeqNum) + 1
'End If
End If
Else
End If
End If
Exit Function
errorhand:
Msgbox "Error in SeqNumGeneration ==>> " + Error$ + " at line number " + Cstr(Erl) + "; Error Code : " + Cstr(Err)
Print "Error in SeqNumGeneration ==>> " + Error$ + " at line number " + Cstr(Erl) + "; Error Code : " + Cstr(Err)
Exit Function
End Function