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 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Shawn Pelletier 17.Feb.12 01:10 PM a Web browser
Applications Development 6.5.4 Windows XP


I have 2 problems I need to address.

1) Object variable not set
See code below for where it is causing an error. This error message pops up on a Forall statement. It is my understanding that an array needs to be declared as a variant for this to work, which I have done. Not sure why I'm getting this error now.

2) Here is what I'm trying to do:
On a button click I need the script to grab the data from a field on the form and compare it against an array (I have this setup already with an array and Forall statement). The first dimension of the array is the name of a person. The second dimension is their email address. I then want an email sent to the email address that corresponds with the name of the person that was pulled from the array.

So...Joe Dirt populates a field, it checks a 2 dimensional array with his name and email address and then sends sends an email to the address in the array. Hopefully my code explains it better. See below.

I need help with the logic and/or how to grab data from 2nd dimension of array. Any direction would be greatly appreciated.Thank you.


Sub Click(Source As Button)

'Declaring form variables
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument

'Setting variables
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set db = session.CurrentDatabase

'Technician Array
Dim TechArray (1 To 2 ,1 To 2) As Variant
TechArray(1,1) = "Joe Dirt, Joe.Dirt@gmail.com"
TechArray(1,2) = "Jane Doe, Jane.Doe@gmail.com"

'Declare variables for email
Dim CVT_Num As NotesItem
Dim CVT_Clli As NotesItem
Dim CVT_Date As NotesItem
Dim CVT_CCR As NotesItem
Dim CVT_WO As NotesItem
Dim CVT_TEO As NotesItem
Dim Requester As NotesItem

'Set email variables
Set CVT_Num = doc.GetFirstItem("CVTNumber1")
Set CVT_Clli = doc.GetFirstItem("CLLI")
Set CVT_Date = doc.GetFirstItem("Date")
Set CVT_CCR = doc.GetFirstItem("CCR")
Set CVT_WO = doc.GetFirstItem("WorkOrder")
Set CVT_TEO = doc.GetFirstItem("TEO")
Set Requester = doc.GetFirstItem("Requestor")


'Setting up mail doc
Dim AdviseDoc As NotesDocument 'declare variable for new mail document
Dim AdviseRtitem As NotesRichTextItem 'declare variable for richtext Item
Dim richStyle As NotesRichTextStyle
Set richStyle = session.CreateRichTextStyle

'Send Email
Set AdviseDoc = New NotesDocument( db) 'assign AdviseDoc as the new mail document
AdviseDoc.Form = "Memo"
AdviseDoc.Subject = "CVT Reconciliation: " + CVT_TEO.Text 'Subject
Set AdviseRtitem = New NotesRichTextItem( AdviseDoc, "Body" )
Call AdviseRtitem.AddNewLine(2)
richStyle.NotesColor = COLOR_BLACK
richStyle.Bold = False
Call AdviseRtitem.AppendStyle(richStyle)
Call AdviseRtitem.AddNewLine(2)
Call AdviseRtitem.AppendText("CVT Number: " + CVT_Num.Text)
Call AdviseRtitem.AddNewLine(1)
Call AdviseRtitem.AppendText("TEO Number: " + CVT_TEO.Text)
Call AdviseRtitem.AddNewLine(1)
Call AdviseRtitem.AppendText("CCR Number: " + CVT_CCR.Text)
Call AdviseRtitem.AddNewLine(1)
Call AdviseRtitem.AppendText("WO Number: " + CVT_WO.Text)
Call AdviseRtitem.AddNewLine(1)
Call AdviseRtitem.AppendText("Clli: " + CVT_Clli.Text)
Call AdviseRtitem.AddNewLine(1)
Call AdviseRtitem.AppendText("Date Reconciled: " + Today)
Call AdviseRtitem.AddNewLine(1)

'Send email message
Forall TechValue In Requester.Values <=================Object variable not set
If Not Isnull(Arraygetindex(TechArray, TechValue)) Then
'This line sends the email
Call AdviseDoc.Send( False, "email address of tech in array") <======== How do I grab email address from array index that was chosen?
Exit Forall
End If
End Forall
End Sub






Grabbing data from 2 dimensional ar... (Shawn Pelletier... 17.Feb.12)
. . RE: Grabbing data from 2 dimensiona... (Stan Rogers 17.Feb.12)
. . RE: Grabbing data from 2 dimensiona... (Carl Tyler 17.Feb.12)
. . . . RE: Grabbing data from 2 dimensiona... (Shawn Pelletier... 20.Feb.12)





  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

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 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


 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