Lotus IBM Question

Lotus script

I have a Helpdesk DB when a case is raised a case number is assigned automatically from a network file. I have not found any way to make it auto via script only. Now some times when network is slow or due to time out the auto number is not picked when a new case is raised.I want either the field be made in such way that it has to wait unless the number is picked or to be automated via lotus script so i may not need the network file. I have pasted the script here. Please help.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      Dim fileNum As Integer
      Dim fileName As String
      Dim NrCrt As Long
      Dim NewNrCrt As Long
      fileNum% = Freefile()
      fileName$ = "\\server\uniqueNo\SRegNo.txt" 'This is the path to the file that keeps the current number
 'If is new doc assign a new number
      If source.IsNewDoc Then
 'Open for reading the file, read the value then close the file
            Open fileName$ For Input Lock Read Write As fileNum% '
            Input #fileNum%,NrCrt
            Close fileNum%
            NewNrCrt=NrCrt+1 'Increment the value
 'Open for writing the file, write the value then close the file
            Open fileName$ For Output Lock Read Write As fileNum%
            Write #fileNum%,NewNrCrt
            Close fileNum%
            If Isnull(NewNrCrt) Then
                  Msgbox("Can't generate the registration number ! Please check the path to the file: " & fileName$ )
            End If
            If Source.FieldGetText("Department")="" Then
                  Msgbox "Please enter the required values such as Department and phone number"
                  Exit Sub
            End If
            Call source.FieldSetText("sRegNo","ITHELP-" & Str$(NewNrCrt)) 'Complete the current number in the form
      End If
End Sub

Trusted by Thousands of Top Companies

  • CVS
  • IBM
  • Boeing
  • US Army
  • Kaiser
  • RalphLauren
  • Xerox
  • Cox
  • BlueCross
  • Accenture
  • Sony
  • Toyota
  • Allstate
  • Att
  • TomTom
  • BBC
  • Raytheon
  • Wells Fargo
  • US Navy
  • Direct TV
  • FootLocker
  • Nikon
  • BritishCouncil
  • TS Army

Related Questions We have nearly 4 million solutions here.

See More Lotus IBM Solutions

Solve Your Difficult Tech Problems Faster with Experts Exchange

Access millions of verified solutions and get 1-on-1 help from the experts.

Try It Free

30 Day free trial.

Experts Exchange gives me a day to day reference of proven solutions that provide me guidance and troubleshooting help for my own clients.

- Brian B. Forte Consulting

Experts Exchange powers the growth and success
of technology professionals worldwide.

  • Solve

    Experts Exchange is the tech professional’s trusted, on-demand resource for solving difficult problems, making informed decisions, and delivering excellent solutions.

  • Learn

    With unparalleled access to technical experts, verified real-world solutions, and diverse educational content, Experts Exchange enables personalized development of technology skills.

  • Network

    Experts Exchange gives you the professional exposure and valued relationships key to building the career you want.

Join the Network Today

See Plans and Pricing