Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Excel Import and Running Scripts
Scott H Walton 26.Mar.01 01:14 PM a Web browser
Domino Designer -- LotusScript 4.6.5c Windows NT

I have a problem I need to solve by the first of April and I was wondering If anyone have run into this. The problem is to Import an Excel speedsheet into a Domino form. I have do this by simply converting the Excel into a 1-2-3 (.wk3) and this works well.
The problem is the script running in the WebQuerySave. Since the import cannot be done on the web. I have to figure out some way to run the script when importing the speedsheet. The script generates a Request Number (unique of course) if the document is new. If the document is not new, then a mail message is sent notifing the person of updates to the form.

Here is the script

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set db = session.CurrentDatabase
Set doc = session.DocumentContext

'check for new document
If Not(doc.IsNewNote) Then
Goto send_notice
End If

Set view = db.GetView("($Numbergen)")

NumberGen:
Dim Prevdoc As NotesDocument
Set Prevdoc = view.GetFirstDocument
Dim CurrentNo As Variant
Dim strSeq, tempseq As String

If Not(Prevdoc Is Nothing) Then
CurrentNo = Prevdoc.GetItemValue("RequestNo")
Else
CurrentNo = "0000000"
End If


If(Isarray(CurrentNo)) Then
tempseq = CurrentNo(0)
Else
tempseq = CurrentNo
End If

strSeq=Trim$(Str(Val(Right$(tempseq,3))+1))

If((Val(strSeq) > 0) And (Val(strSeq)<10)) Then
strSeq = Trim$("0000000" & strSeq)
Goto AssignNumber
End If

If ((Val(strSeq) >= 10 And Val(strSeq) < 100)) Then
strSeq = Trim("000000" & strSeq)
Goto AssignNumber
End If

If ((Val(strSeq) >= 100 And Val(strSeq) < 1000)) Then
strSeq = Trim("00000" & strSeq)
Goto AssignNumber
End If

If ((Val(strSeq) >= 1000 And Val(strSeq) < 10000)) Then
strSeq = Trim("0000" & strSeq)
Goto AssignNumber
End If

AssignNumber:
Number = Trim(strSeq)
doc.RequestNo = Number
Call doc.Save(True,False)

send_notice:
previous_assignedemail = doc.GetItemValue("previous_assignedemail")
assigned_to_email = doc.GetItemValue("assingned_email")

If previous_assignedemail(0) = assigned_to_email(0) Then
Exit Sub
End If

issue = doc.GetItemValue("issue")
docid = doc.GetItemValue("docid")
current_user = doc.GetItemValue("remote_user")
doc.previous_assignedemail = doc.assingned_email
Call doc.Save(True, False)

msg2 = "Request No: " + doc.RequestNo(0) + Chr(10) + Chr(10) + "Name: " + doc.first_name(0) + " " + doc.last_name(0)
msg2a = "Company: " + doc.company(0) + Chr(10) +"Phone No: " + doc.phone(0) + Chr(10) + "E-Mail: " + doc.email(0)
msg3 = "Inquiry: " + doc.inquiry(0) + Chr(10) + "Other: " + doc.inquiry_other(0) + Chr(10) + Chr(10) + "Issue: " + issue(0)
msg4 = msg2 + Chr(10) + Chr(10) + msg2a + Chr(10) + Chr(10) + msg3 + Chr(10) + Chr(10) + "http://dsks89.itg.ti.com/rfid/pic.nsf/DocID/" + docid(0) + "?OpenDocument"
Call MailSend(db,current_user(0), assigned_to_email(0), "", "", "Request No " & doc.RequestNo_1(0) & " has been assigned to you", msg4, "H") '//This is for debug purposes. Redirect the Notify Email to anyone.
Call doc.Save(True,False)
End Sub

The questions are,
1. is there anyway to run this during the import just after the save?
2. Or what is the best way to alter the script to accept the number generation after the document has been created. Because I have a view the looks at the documents after the import and If just need to alter the script to accept the number generation if the document is not new.

Any help would be great






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow