nenadkov
asked on
Change main form field.
The "main" form has the fields "Name" and "LastName" (computes).
On changing the field "Name" value (eg. the name is not entered corectly), on Qsave I nedd to search all documents with the field "Name" in db and change its value (some od documents are responses to "main" form but some are not).
I tried with view "AllDocuments" and next script in Qsave:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection
Name = Source.FieldGetText("LastN ame")
Set db = session.CurrentDatabase
Set view = db.GetView("AllDocuments")
Set vc = view.GetAllEntriesByKey("N ame")
Set entry = vc.GetFirstEntry()
While Not ( entry Is Nothing)
Set doc = entry.Document
Call doc.ReplaceItemValue( "Name", Name)
Call doc.Save (True, False)
Set entry = vc.GetNextEntry(entry)
Wend
-but no result. What is the proper way to solve this task. Thanks.
On changing the field "Name" value (eg. the name is not entered corectly), on Qsave I nedd to search all documents with the field "Name" in db and change its value (some od documents are responses to "main" form but some are not).
I tried with view "AllDocuments" and next script in Qsave:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection
Name = Source.FieldGetText("LastN
Set db = session.CurrentDatabase
Set view = db.GetView("AllDocuments")
Set vc = view.GetAllEntriesByKey("N
Set entry = vc.GetFirstEntry()
While Not ( entry Is Nothing)
Set doc = entry.Document
Call doc.ReplaceItemValue( "Name", Name)
Call doc.Save (True, False)
Set entry = vc.GetNextEntry(entry)
Wend
-but no result. What is the proper way to solve this task. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
good suggestion Qwaletee
That was mine. Qwaletee do you remember saying that stampAll is inefficient ??? Or was that you Partha ???
;-)
Good morning to all you Experts!
;-)
Good morning to all you Experts!
Arun,
I didn't say that it was inefficient,. but there are some places where stampall doesn't work as intended....
peace
Partha
I didn't say that it was inefficient,. but there are some places where stampall doesn't work as intended....
peace
Partha
stampAll is really, really efficient. Sometimes a little to efficient -- if the document you are working on is in teh collection, you can get conflicts.
How to incorporate a Search Function in the Document Library?
spacediver,
> How to incorporate a Search Function in the Document Library?
By asking your own question?
> How to incorporate a Search Function in the Document Library?
By asking your own question?