LS Help Please

I found this script on this forum and it works really well to create the location document titled ‘Office(Network)’. How do I add/modify this script so it will go through and create one more location called ‘Disconnected’?I have no knowledge of Lotus Script, and will greatly appreciate any help.

Thank You

Helen


Script:

Sub Click(Source As Button)

Dim db As NotesDatabase

Dim doc As Notesdocument

Dim session As New NotesSession



Set db = session.GetDatabase("", "names.nsf")

If db Is Nothing Then

	Messagebox "Sorry, names.nsf not found!"

	Exit Sub

	

Else

	Set doc = New NotesDocument(db)

	doc.Form = "Location"

'These are the base fields.

'Change them to suit your needs, and include more based on your needs.

'The LocationType 0 is for Local Area Network.

'Change this according to Dialup, etc.

	doc.MailServer = "My Server Name"

	doc.Domain = "My Domain"

	doc.Name = "Office(Network)"

	doc.LocationType = "0"

	doc.DefaultPassthruServer = ""

	doc.CatalogServer = ""

	doc.DirectoryServer=""

	doc.SametimeServer="My Sametime Svr"

	doc.MessageFormat="0"

	doc.WebRetriever="2"

	If doc.ComputeWithForm(True, True) Then

		Call doc.save(True, True)

		Msgbox "Location document successfully created!"

		

	End If

End If

End Sub

Subject: LS Help Please

Same as above…

doc.locationType = “3”

is the connection type…

Everything else is arbitrary.

Also, you should fill your directory server value also.

You can how to set doc fields by the example you submitted, now look at the fields you need to populate in the form with your unique needs and adjust the script accoridingly…

Subject: RE: LS Help Please

Brett,Thanks for your response. What I was asking is something like this. Sorry for not knowing the technical terms.

Action 1 - First Do Script to create ‘Network’ location

with desired fields filled accordingly(ex. mail file location=server.etc)

Action 2 - then Do Script to create ‘Disconnected’ location

with desired fields accordingly (ex. mail file location=local…etc)

When finished pop up the message box.

I don’t know how to combine Action 1 and Action 2 using LS.

Am I making sense?

Helen

Subject: RE: LS Help Please

As Brett said - just copy the code that’s actually creating the document and paste it back in with new values:

Sub Click(Source As Button)

Dim db As NotesDatabase

Dim doc As Notesdocument

Dim session As New NotesSession

Set db = session.GetDatabase(“”, “names.nsf”)

If db Is Nothing Then

Messagebox “Sorry, names.nsf not found!”

Exit Sub

Else

Set doc = New NotesDocument(db)

doc.Form = “Location”

'These are the base fields.

'Change them to suit your needs, and include more based on your needs.

'The LocationType 0 is for Local Area Network.

'Change this according to Dialup, etc.

doc.MailServer = “My Server Name”

doc.Domain = “My Domain”

doc.Name = “Office(Network)”

doc.LocationType = “0”

doc.DefaultPassthruServer = “”

doc.CatalogServer = “”

doc.DirectoryServer=“”

doc.SametimeServer=“My Sametime Svr”

doc.MessageFormat=“0”

doc.WebRetriever=“2”

If doc.ComputeWithForm(True, True) Then

Call doc.save(True, True)

Set doc = New NotesDocument(db)

doc.Form = “Location”

'These are the base fields.

'Change them to suit your needs, and include more based on your needs.

'The LocationType 0 is for Local Area Network.

'Change this according to Dialup, etc.

doc.MailServer = “My Server Name”

doc.Domain = “My Domain”

doc.Name = “Disconnected”

doc.LocationType = “3”

doc.DefaultPassthruServer = “”

doc.CatalogServer = “”

doc.DirectoryServer=“”

doc.SametimeServer=“My Sametime Svr”

doc.MessageFormat=“0”

doc.WebRetriever=“2”

If doc.ComputeWithForm(True, True) Then

Call doc.save(True, True)

Msgbox “Location documents successfully created!”

End If

End If

End Sub

Subject: RE: LS Help Please

Esther,Thank you sooo much. This works great.

Helen