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

Append or Replace
Nadeem Shaikh 25.Jan.04 05:27 PM a Web browser
Domino Designer -- LotusScript 4.6.5a Windows NT

Hi,

This piece of code retrieves values from a document and then places them in a members field of a group document in an address book...the group documents have been pre-created in the address book but the problems i am having is that i need to do the while loop, populate a temporary document and then compare that with the current group document...but i am falling over with my append or replaceitemvalue statement....can someone id where i am going wrong..or has similar code


i have stated in my code below:

'PROBLEMS HERE
tempgroup1doc.Members = ""

i am using the for i = 1 to 6 incorrectly ?

My code:

Sub Initialize
'Main code:
'Declarations

Set v = db.getview("DivisionsV")
Dim pabview As NotesView
Set pabview = PABdb2.GetView ( "Groups" )


'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Set Unidoc = v.getfirstdocument

count = 0

Dim TAllACPO() As String
Dim i As Integer

Do Until Unidoc Is Nothing
If unidoc.DivName(0) = "Ghost" Then
Exit Sub
End If

'Processing here

Call ACOMember

Set Unidoc = v.getnextdocument(Unidoc)
count = count + 1
Print count
Loop
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Else
Msgbox "nab isn't open"
End If
Call SiteDivAllStaffMembers
Call SiteTeamAllStaffMembers
'END OF MAIN CODE
End Sub





6666666666666666666666666666666666666



Sub ACOMember

Dim s As New notessession
Dim p As Variant
Dim q As Variant
Dim u As Variant
Dim y As Variant
' Dim i As Integer
Group(1) = "All ACOs"
Group(2) = Unidoc.DivName(0) & " ACOs"
Group(3) = Unidoc.DivName(0) & " DMT"
Group(4) = "AST"
Group(5) = Unidoc.DivName(0) & " All Staff"
Group(6) = "All Probation Grade Staff"

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
p = unidoc.DivACPO

For i = 0 To Ubound(p)
If i = 0 Then Redim q(i)
If i > 0 Then Redim Preserve q(i)
If p(i) = "" Then
q(i) = ""
Else
q(i) = p(i) & "/WestMidlands/NPS"
End If
Next
y = q ' eg.... y = Pat Royal/WestMidlands/NPS
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Dim pabview As NotesView
Set pabview = PABdb2.GetView ( "Groups" )

For i = 1 To 6
'current
Set group1doc = pabview.getdocumentbykey(Group(i))
Set group1members = group1doc.Getfirstitem("Members")
'new
Set tempgroup1doc = pabdb2.createdocument
tempgroup1doc.Form = "Group"
tempgroupmembers = group1doc.Members
'+++++++++
'PROBLEMS HERE
tempgroup1doc.Members = ""

'+++++++++
tempgroup1doc.ListName = Group(i) & "TG" ' TG = Temporary Group
tempgroup1doc.Type = "Group"
Set tempgroup1members = tempgroup1doc.GetFirstItem("Members2")

For x = 0 To Ubound(y)
Call tempgroup1members.AppendToTextList ( y(x) )
Next

Call tempgroup1doc.Save(True, False)

Call pabview.Refresh
Set group1doc = pabview.getdocumentbykey(Group(i))
Set tempgroup1doc = pabview.getdocumentbykey(Group(i) & "TG")

Dim groupmemberitem As NotesItem
Dim tempmemberitem As NotesItem
Dim text1 As String
Dim text2 As String

Set groupmemberitem = group1doc.GetFirstItem("Members")
Set tempmemberitem = tempgroup1doc.GetFirstItem("Members2")
text1 = groupmemberitem.Text
text2 = tempmemberitem.Text

If text1 <> text2 Then
Set group1members = group1doc.ReplaceItemValue("Members",tempgroup1doc.members)
Call group1doc.Save(True, True)
Call tempgroup1doc.Remove(True)
Else
' Print Group(i) & " list is still the same, wont save document"
Call tempgroup1doc.Remove(True)
End If
Next

End Sub




Append or Replace (Nadeem Shaikh 25.Jan.04)
. . Off topic reply (Doug Finner 26.Jan.04)
. . Press F1 eom> (Kevin Price 26.Jan.04)






  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