Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Button to create Location and Connection Documents

Posted on 2003-11-25
10
Medium Priority
?
234 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 1400 total points
ID: 9840816
There is another link below in the thread gives you english version of it.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

730 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