?
Solved

Agent needed to find & replace

Posted on 2002-07-17
7
Medium Priority
?
197 Views
Last Modified: 2013-12-18
I have merged message/data from two different Domino DBs.

One DB form uses a field called title the other uses a field called subject, essentially the same info.

I need a manual agent takes the value from the title field and copies it to a newly create field call subject.  The field in question only has 1 value.


I already have another agent that will then delete the old title field.
0
Comment
Question by:jason_turner
7 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 200 total points
ID: 7160327
Assuming Manually run agent on selected documents.

FIELD Subject := Title;
""

~Hemanth
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 7160330

Here is a sample set of code that may help.

It has some extras in it, that may not be needed.
-------------------------

Sub Initialize
    Dim session As New NotesSession
    Dim Doc As NotesDocument
    Dim InitialValue As Integer
    Dim item As NotesItem
    Dim NewNumber As Integer
    Dim Failures As Integer
    Dim OldNumber As Variant
    Dim x As Variant
    Dim Coll As notesdocumentcollection
    Dim dateTime As New NotesDateTime( "12/01/94" )  
    Dim success As Variant
    Dim Count As Integer
    Dim stringArray ( 1 To 9 ) As String
    Dim OldRSM, NewRSM As String
   
    Failures = 0
   
    Count = 0
    Set db = session.CurrentDatabase    
    Print("Searching...")
    Set Coll = db.Unprocesseddocuments
    Set Doc = Coll.getfirstdocument
   
    While Not doc Is Nothing        
         Count = Count + 1
         Print(Cstr(Count) + " of "+Cstr(Coll.Count)+"      "+Cstr(Round((Count/Coll.Count),1))+"%")
         
         doc.title= doc.subject
         Call Doc.Save(True,True)
         Set Doc = coll.getnextdocument(doc)
    Wend
    Print("Finished")
    Print("Found "+Cstr(Failures)+" failures")
End Sub
 
0
 
LVL 13

Expert Comment

by:CRAK
ID: 7160358
Create an agent runing on all documents in database, containing folowing code:

  Field Subject := @Trim(Subject:Title);
  Field Title := @Unavailable

This agent modifies EVERY document in the database; not only the ones holding "Title". Just to keep the code VERY short and plain!

It creates a list containing both "Subject" and "Title". Assuming one of them is empty @Trim removes the empty element from the list. The result is passed to "Subject".

The second line removes the "Title" from the document (if you want to use only one agent to do both).

You could test it on selected documents first to test different situations, if you run the agent on "selected documents" instead!
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 7160534
Crak, read the question.. Jason already has another agent to take care of deleting fields.

Hello sys
0
 
LVL 1

Author Comment

by:jason_turner
ID: 7160586
Short, sweet and it works.

Thanks again. More easy ones to come.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 7160622
Hemanthakumar,
Read the comment: "IF you want to use only one agent...."
Be honest about it: would you use a separate one?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 7160656
Crak: Honestly, user wants it like that.

Jason thanks for the points.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

621 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