Lotus script

    Question by:
    On

    Topics:

    HI;
    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.
    Thanks

    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"
                      continue=False
                      Exit Sub
                End If
                Call source.FieldSetText("sRegNo","ITHELP-" & Str$(NewNrCrt)) 'Complete the current number in the form
          End If
    End Sub

    Good Question?
    0
     

    ?

    The member who asked this question verified this comment provided the solution that solved their problem.

    Accepted Solution on 2009-10-08 at 04:00:57ID: 25523922

    let this case be open for some time,

    Top Expert Contributor

    Essential articles and videos from the Experts

    More valuable questions with Expert answers

    201511-LO-Qu-074

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    Rob Hutchinson

    11

    Articles

    591

    Solutions

    Expert in:

    • Hardware-Other
    • Laptops/Notebooks
    • Networking-Other
    • Outlook
    • Printers and Scanners

    jvutechnc

    1

    Articles

    1

    Solutions

    amilie wilson

    5

    Articles

    26

    Solutions

    Amaira Sahni

    5

    Articles

    Emmanuel Gleizer

    1

    Articles

    43

    Solutions

    Sudhakar Kumar

    1

    Articles

    209

    Solutions

    Expert in:

    • BlackBerry Prog

    MouseCaptain

    1

    Articles

    5

    Solutions

    RELATED TOPICS view all topics

    1. Exchange
      (195,984)
    2. Email Clients
      (18,287)
    3. Outlook
      (93,833)
    4. MS Excel
      (125,168)
    5. Email Servers
      (23,601)
    6. BlackBerry
      (7,612)
    7. Email Protocols
      (13,771)
    8. MS Access
      (214,070)
    9. Visual Basic Classic
      (162,826)
    10. Databases-Other
      (53,011)