Link to home
Start Free TrialLog in
Avatar of nenadkov
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("LastName")
      
      Set db = session.CurrentDatabase
      Set view = db.GetView("AllDocuments")
      Set vc = view.GetAllEntriesByKey("Name")
      
      
      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
Avatar of p_partha
p_partha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
good suggestion Qwaletee
Avatar of Arunkumar
Arunkumar

That was mine.  Qwaletee do you remember saying that stampAll is inefficient ???  Or was that you Partha ???

;-)

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
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?