Posted on 2006-06-13
Hey, can anybody help me out here, I'm drawing a blank for some reason!
I want a lotusscript that will run and select a document from a custom domino directory and then change a value in the doc and save it. Basically its a password change custom form. User will enter the username and a "company" name. The script will find the correct document, automatically generate a password, update the internet password field, save the doc, send an email to the initiating user containing the username and password changes. I've got everything but how to select the correct person document to update. I was looking at GetDocumentByKey but I need to have two "key" values and am kind of confused. Can someone please straighten me out!! Thanks!!!
Heres where I'm at so far:
Dim doc As NotesDocument
Set doc = Session.DocumentContext
Set db = Session.Currentdatabase
Dim db As NotesDatabase
Dim Session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIdocument
Dim Username As String
Dim Password As String
Set uidoc = workspace.currentdocument
Set db = New NotesDatabase("wtecdom","supusers.nsf")
If uidoc.FieldGetText("FirstName") = "" Then
Msgbox "You must enter the users first name.",,"Entry Error"
If uidoc.FieldGetText("LastName") = "" Then
Msgbox "You must enter the users last name.",,"Entry Error"
If uidoc.FieldGetText("VendorNumber") = "" Then
Msgbox "You must enter the users associated Vendor Number.",,"Entry Error"
Username = Trim$(uidoc.FieldGetText("FirstName")) + Trim$(uidoc.FieldGetText("LastName"))
***code to gen password
***code to select doc based on Username and VendorNumber (this is what I really need!!!)
***set doc password to password
Hope this isn't too confusing!! Thanks!!