Solved

Illegal use of PROPERTY

Posted on 2009-04-03
2
723 Views
Last Modified: 2013-12-18
I am trying to select two documents, store the values of the first document, then set the values of the second document to equal the first, but when I run the agent I get the "Illegal use of PROPERTY" error.
Sub Initialize
	Dim s As New NotesSession
	Dim db As NotesDatabase
	Dim docs As NotesDocumentCollection
	Dim doc As notesdocument
	Dim Q_1 As String
	Dim output_1 As String
	Dim cirats_1 As String
	Dim comments_1 As String
	Dim Q_2 As String
	Dim output_2 As String
	Dim cirats_2 As String
	Dim comments_2 As String
	Dim Q_3 As String
	Dim output_3 As String
	Dim cirats_3 As String
	Dim comments_3 As String
	Dim Q_4 As String
	Dim output_4 As String
	Dim cirats_4 As String
	Dim comments_4 As String
	Set db = s.CurrentDatabase
	Set docs = db.UnprocessedDocuments
	Set doc = docs.GetFirstDocument( )
	Do While Not (doc Is Nothing)		
'Part One
		If doc.Q_1(0) <> "" Then
			Q_1 = doc.Q_1(0)
			output_1 = doc.output_1(0)
			cirats_1 = doc.cirats_1(0)
			comments_1 = doc.comments_1(0)
		End If
		If doc.Q_2(0) <> "" Then
			Q_2 = doc.Q_2(0)
			output_2 = doc.output_2(0)
			cirats_2 = doc.cirats_2(0)
			comments_2 = doc.comments_2(0)
		End If
		If doc.Q_3(0) <> "" Then
			Q_3 = doc.Q_3(0)
			output_3 = doc.output_3(0)
			cirats_3 = doc.cirats_3(0)
			comments_3 = doc.comments_3(0)
		End If
		If doc.Q_4(0) <> "" Then
			Q_4 = doc.Q_4(0)
			output_4 = doc.output_4(0)
			cirats_4 = doc.cirats_4(0)
			comments_4 = doc.comments_4(0)
		End If
'Part Two
		Print "starting part two"
		If doc.Q_1(0) = "" Then
			doc.Q_1(0)= Q_1
			doc.output_1(0) = output_1
			doc.cirats_1(0) = cirats_1
			doc.comments_1(0) = comments_1
		End If
		Print "Q_2"
		If doc.Q_2(0) = "" Then
			doc.Q_2(0) = Q_2
			doc.output_2(0) = output_2
			doc.cirats_2(0) = cirats_2
			doc.comments_2(0) = comments_2
		End If
		Print "Q_3"		
		If doc.Q_3(0) = "" Then
			doc.Q_3(0) = Q_3
			doc.output_3(0) = output_3
			doc.cirats_3(0) = cirats_3
			doc.comments_3(0) = comments_3
		End If
		Print "Q_4"
		If doc.Q_4(0) = "" Then
			doc.Q_4(0) = Q_4
			doc.output_4(0) = output_4
			doc.cirats_4(0) = cirats_4
			doc.comments_4(0) = comments_4
		End If
'Part Three
		Call doc.Save(True,False)
		Set doc = docs.GetNextDocument(doc)
	Loop
End Sub

Open in new window

0
Comment
Question by:scanjema
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
mbonaci earned 125 total points
ID: 24064082
When you are setting the field value don't use (0), use it only when reading the field's value (cuz' fields are line arrays, so 0 is the value of single value field & first element of multivalue field)

e.g. instead of
    doc.Q_1(0)= Q_1
use
    doc.Q_1 = Q_1
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 24064111
You cannot set it like that, if you ever need to set multiple elements of multivalue field, use NotesItem's AppendToTextList method.
The other way would be to create an array, fill it and then assign it to the field.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LOtus Notes 6.5 low performance 13 36
Lotes Notes 8.5.3 std can not open calendar 2 107
Lotus notes view not working using Trim 14 209
Lotus Notes transfer mail box problem 6 101
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question