Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - Script to Change a field Value

Status
Not open for further replies.

zulu1ghz

Technical User
Sep 10, 2002
19
0
0
GB
Hi All,

I'm hoping somebody on here may be able to help me out.

I'm making some changes to a workflow application that we've got, it's pretty basic stuff which I can handle via simple functions and alike. It's in Notes 7.

I've come across a challenge tho, by creating a step in the workflow all of our current closed calls need to have their status field incremented by one.

Currently a status of 4 = Call Closed, going forward this is going to be a status of 5. The issue I've got is about 8,000 documents with a status of 4 as these will cause issues with the new views.

Could anybody point me in the right direction on how I can create a lotusscript to run in an agent as a one off to change a field called txtStatus to 5 for all documents where it currently equals 4?

I'd be very grateful for any assistance.

Thanks
Steve

 
dim session as new notessession
dim db as notesdatabase
dim docColl as notesdocumentcollection
dim doc as notesdocument

set db = ses.currentdatabase
set dbColl = db.alldocuments 'if all documents need to be checked

set doc = docColl.getFirstDocument

while not doc is nothing
if doc.txtStatus(0) = "4" then 'presume field is of type String
doc.txtStatus = "5"
call doc.save(true, false, false)
end if
set doc = docColl.getnextdocument(doc)
wend

Save the agent as run from agentlist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top