Create Test User Profile Location Documents Via Email During Database Testing

Developers always have to go to the user's PC to create location documents for
testing IDs in order to manually switch them during testing of a new database.
This is a lot of work. Why not email your users a hotspot button and let them
do all the rest of the work for you?

I have created a function so that you just need to plug in all the basic
information like Home Mail Server, mail file filepath, ID filepath etc. The
next thing to do is to create a hotspot button and email it out to your users.
Try it and feedback to me how it works for you!!! :-)
(1) Syntax:
-----------
iReturn = CreateLocation (session, strLocationType$, strName$, strMailServer$,
strMailFile$, strDomain$, strUserID$)


(2) Function:
-------------
Function CreateLocation (session As NotesSession, _
strLocationType As String, strName As String, strMailServer As String, _
strMailFile As String, strDomain As String, strUserID As String) As Integer
%REM
This function will create a new location document in user's local address
book.
INPUT PARAMETERS:
(1) session - a connected Notes session,
(2) strLocationType
"0" for Local Area Network,
"1" for Dialup Modem,
"2" for Both Dialup & Local Area Network,
"3" for No connection
(3) strName - a description given to the location
(4) strMailServer - the fully qualified Mail Server name
(5) strMailFile - the file path for the targeted user's mail file
(6) strDomain - the mail domain name
(7) strUserID - the file path for the user ID.
%END REM
Dim db As NotesDatabase
Dim doc_location As NotesDocument
Set db = session.GetDatabase("","names.nsf")

CreateLocation = True
Set doc_location = db.CreateDocument
If doc_location Is Nothing Then
CreateLocation = False
Exit Function
End If

doc_location.Form = "Location"
doc_location.Type = "Location"
doc_location.Source = "*"
doc_location.LocationType= strLocationType
If doc_location.LocationType(0) = "0" Or _
doc_location.LocationType(0) = "2" Then
doc_location.MailType = "0"
doc_location.MailTypeDirect = "0"
doc_location.MailTypeLocal = "1"
Elseif doc_location.LocationType(0) = "1" Or _
doc_location.LocationType(0) = "3" Then
doc_location.MailType = "1"
doc_location.MailTypeDirect = "0"
doc_location.MailTypeLocal = "1"
End If
doc_location.Name = strName
doc_location.MailServer = strMailServer
doc_location.MailFile = strMailFile
doc_location.Domain = strDomain
doc_location.UserID = strUserID
doc_location.ComputeWithForm False,False
doc_location.Save True,False
End Function

(3) Example
-----------
In the Click event of a button:-
Sub Click(Source As Button)
Dim session As New NotesSession
strLocationType$ = "0"
strName$ = "Teck Lung"
strMailServer$ = "ORGNAME/ORGUNIT/ORG"
strMailFile$ = "mail\tecklung.nsf"
strDomain$ = "ORGDOMAIN"
strUserID$ = "c:\notes\data\tecklung.id"
If CreateLocation (session, strLocationType$, strName$, strMailServer$,
strMailFile$, strDomain$, strUserID$) = False Then
Msgbox "!!!Error creating location document."
End If
End Sub
This was first published in November 2000

Dig deeper on LotusScript

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close