Solved

Button to create Location and Connection Documents

Posted on 2003-11-25
10
228 Views
Last Modified: 2013-12-18
Hi Guys

I need to create a button that I can email . It has to create a location document and connection document.

Any Ideas

James
0
Comment
Question by:adspmo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9818992
I actually have one of those around here somewhere, let me check. if not, it is easy enough to write one.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9819003
Oh, before I do this... R5 or R6?  And which paraneters do you want to set?

Location -- name, type, ports, mail-local/server, server name, mail file location (the last two can be retrieved from Person doc, assuming user already has access to it).  Often, the best option is to copy the current location doc, and change the minimum needed.

Connection -- need server name, address.
0
 

Author Comment

by:adspmo
ID: 9819193
Hi

I am sending out a memo to people that will be testing a new application.

It is on a test sever and there is no cross certification between the TestPMO and the SITA domain.
I figure the easiest is to have the folks press abutton that will create anew location document and a connection document if one doesn't already exist to allow them into my domain. I will also be sending a ID that the location document will automatically open when changed.

James
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9819335
Ok here is the quickie...

Which does both connection and location doc setup

http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/3aa7da395066a28b85256982004fb86a?OpenDocument

~Hemanth
0
 

Author Comment

by:adspmo
ID: 9820601
I looked at this and tried it I am not having much luck
I will keep try ,however I need to get this working, the big boys are hovering

James
Sub Click(Source As Button)
      
      Dim ws As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim view As NotesView
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim num As Integer
      
      Set db = New NotesDatabase( "", "names.nsf" )
      Set view = db.GetView( "Connections" )
      Set doc = view.GetFirstDocument
      
      While Not doc Is Nothing
            Call doc.Remove(True)
            Set doc = view.GetFirstDocument
      Wend      
      
      Set uidoc = ws.CurrentDocument
      Set doc = uidoc.Document
      
      num = 1
      While uidoc.FieldGetText( "Server_" + Cstr( num% ) ) <> ""
            Call CreateConnection( db, "0", "", uidoc.FieldGetText( "Server_" + Cstr( num% )), uidoc.FieldGetText( "ServerAddress_" + Cstr( num% )), "*" )
            If doc.PassthruYN(0) = "1" Then
                  Call CreateConnection( db, "2", doc.Passthru(0), uidoc.FieldGetText( "Server_" + Cstr( num% )), "", "Internet" )
            End If
            num% = num% +1
      Wend
      
      Call CreateConnection( db, "0", "", doc.Sametime(0), doc.ServerAddress_ST(0), "*" )
      
End Sub

Function CreateConnection( Database As NotesDatabase, CType As String, PTServer As String, SName As String, SAddress As String, OFLocation As String )
      
      Dim doc As NotesDocument
      
      Set doc = New NotesDocument( Database )
      If CType = "0" Then
            doc.OptionalNetworkAddress = "10.22.0.200"
      Else
            doc.PassthruServer = PTServer
      End If
      doc.Form = "Connection"
      doc.ConnectionType = "Local Area Network"
      doc.Destination = "Developer1/TestPMO"
      doc.LanPortName = "TCPIP"
      doc.ConnectionLocation = "TestPMO"
      doc.Source = "*"
      doc.ConnectionRecordFirst = "1"
      Call doc.ComputeWithForm( True, True )
      Call doc.Save(True, True)
      
End Function

0
 

Author Comment

by:adspmo
ID: 9833791
I need help with this still

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9834238
What is the problem James ?

Is the code not working or giving you errors ?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9834473
adspmo,

When Hemanth beat me to the punch, I was going to abandon.  But I like picking apart others' code.  For example:

>      While Not doc Is Nothing
>           Call doc.Remove(True)
>           Set doc = view.GetFirstDocument
>      Wend    


This is a bad thing.  It says, "to bad if you had any old connection docs, I think yuo shoudln't have any."  Great.  In other words, if I'm not smart enough to figure out whether I'm replacing a particular connection (i.e., user already has a connection to a particular server), then I think I'll just trash 'em all.

Next, that whole      While uidoc.FieldGetText( "Server_" + Cstr( num% ) ) <> ""
bit is a bit too much for you.  It assumes yu have some sort of "setup doc" that describes all the connections yuo want to make.  Well, you don't have that.  All you need is the line:

               Call CreateConnection( db, "2", "pass thru name", "destination server", "", "Location name" )

Of course you are not using a pass trhu server.  So, the "2" is wrong (s/b "0"), and most likely that "" s/b the IP address.  So, we would get:

               Call CreateConnection( db, "0", "", "destination server", "destination address", "Location name" )

0
 

Author Comment

by:adspmo
ID: 9834870
First the db example was in german, So I had to guess at a few things. It doesn't workfor me

I think you are right qwalatee ,I need to keep it simple  

I will try tomorrow
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 350 total points
ID: 9840816
There is another link below in the thread gives you english version of it.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HP DP 7.03 and lotus collaboration suite 9 3 172
Re sizing Server 2003 D: drive without taking it down, no more HDD space left 6 172
Domino Server 11 81
IBM Lotus notes 9 107
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…

738 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