Question

Lotus script

Asked by: aib_it

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

This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Sign Up Now!
Asked On
2009-05-06 at 23:26:15ID: 24387773
Topics

Lotus Domino Email Server

,

Lotus Notes

Participating Experts
3
Points
500
Comments
24

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

Companies like CVS, Honeywell, Chevron, Toyoto, TriStar Pictures, the U.S. Army, and Accenture

Your Complete Technology Resource

900+ topic areas (and counting)

Related Solutions

  1. Lotus Script equivalent
    Whats the lotus script equivilent for: @Command([MailComposeMemo]) ; @Command([EditInsertText]; "Hemanth")
  2. NotesUIDocument Save Changes Even Though S…
    I've listed my code below. I'm wondering why, after this script runs, Notes still prompts the user to Save Changes. It's driving me insane. As you can see, I call uidoc.Save right before uidoc.Close, so I'm wondering if this is one o...
  3. Lotus Script and Query Save
    I have the following lotus script. The Field res, is changed when the form is open, but when I take a look at the value in the script, the value is the old value. If I move this code into PostSave then the field has the correct value. I...
  4. Input Validation - how to stop Save & Close acti…
    Hi Experts! I was doing my field verification under each field - and had a Save & Close action with the following formula: @If(!@IsValid;@Return("");@Success); @Command([FileSave]); @Command([CloseWindow]) Now I have mov...
  5. Unprocessed document is emptly in querysave e…
    I have an action button in a view to create a document @Command([Compose];"KPI"); @UpdateFormulaContext; @SetField("Action";"123") When I save the document there is a querysave agent Sub Querysave(Source...
Tutorials are great ways to tackle hard problems!

Featured Articles

Read through articles written by top experts!

Get full access to the help you need.

Subscribe Now

30-day free trial. Register in 60 seconds.

The Latest Technology News and Tips

Your answer is only minutes away!

New Solutions Everyday

Because of our active community of experts, on average new questions receive their first comment in under 30 minutes.

Top Lotus Domino Questions

       

Hear What our Users are Saying

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

20130221-EE-VQP-039

3 Ways to Join

30-Day Free Trial

Why Experts Exchange?

Trusted by 44 of the Top Fortune 50 Companies. Verizon, Bank of America, IBM, Windows, Dell, Target, Boeing, Comcast, AT&T

Why Experts Exchange?

The go-to tech resource for hundreds of thousands.

"With the help of Experts Exchange -- I have been able to meet my deadlines and produce effective products"

Jan Miller

"I just today started my third contract assignment which I attribute to the skills I am learning from other experts."

Robert Antonellis

"It's my sole resource as I'm kind of an MS Access loner at my company. It's like having colleagues available when I run out of my own steam."

Karen Ruskin

Why Experts Exchange?

50K Tech Experts available to help

Leew has been an expert here since 1997 and is a master at Windows 2000 and XP, hard drives/storage and Small Business Server.

lrmoore has been an expert here since 2000 and is a six-time Microsoft MVP with over 18 years experience in the networking industry.

angeliii has been an expert here since 2000 and is a Microsoft MVP for his work with MS SQL Server and Development

Why Experts Exchange?

3 Million+ Questions Solved

"The experts approach solutions with patience and innovative ideas, and ultimately I have my problem solved."

Gary Serkhoshian

"Most every situation is already posted and answered, a quick search usually gives a solution. EE is truly a bargain."

Bob Schatzman

"9 out of 10 times Experts Exchange has the accepted solution or an open discussion of the potential solutions to the problem."

Kenny Red

Why Experts Exchange?

Serving tech professionals since 1996.

At Experts Exchange, we treat each question as unique and deserving of an answer.

As one of the most enduring technology resources, our community knows the importance of helping each individual with their problem, no matter how complex or how simple. We're here to collaborate with you.

Business Account Plans