Solved

Button to create Location and Connection Documents

Posted on 2003-11-25
10
221 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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