Solved

Button to create Location and Connection Documents

Posted on 2003-11-25
10
215 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:adspmo
Comment Utility
I need help with this still

0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
What is the problem James ?

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

Expert Comment

by:qwaletee
Comment Utility
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
Comment Utility
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
Comment Utility
There is another link below in the thread gives you english version of it.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now