Solved

How to add a link to  an Appointment via LotusScript

Posted on 2012-03-15
6
13 Views
Last Modified: 2016-06-23
I have the following code to create an appointment and works good but I need to add a link to the appointment


Sub Initialize
      Dim ws As New NotesUIWorkspace
      Dim session As New NotesSession      
      Dim maildb As New NotesDatabase( "", "" )
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim uidoc As NotesUIDocument
      Dim auditado,lider,observador,acompañante,tecnico,coordinadorQA,gerente,jefedepto As String
      
      Set uidoc=ws.currentdocument
      
      If ws.currentdocument.editmode Then
            Call ws.currentdocument.save      
      End If
      
      Set db = session.currentdatabase
      Call maildb.OpenMail
      Set doc = maildb.createdocument
      
      'get the mails of the invited
      auditado = uidoc.Fieldgettext("cargoAuditado_1")
      lider = uidoc.Fieldgettext("cargoAuditado_1_1")
      observador = uidoc.Fieldgettext("cargoAuditado_1_1_1")
      acompañante = uidoc.Fieldgettext("correoAcompanante")
      tecnico = uidoc.Fieldgettext("correoAcompanante_1")
      
      doc.form            = "Appointment"
      doc.AppointmentType = "3"
      doc.subject         = "Notificación Auditoría " + uidoc.Fieldgettext("numeroauditoria")
      doc.StartDate       = CDat(uidoc.Fieldgettext("n1_5_1"))
      doc.StartDateTime   = CDat(uidoc.Fieldgettext("horaplaneada"))
      doc.EndDateTime     = CDat(uidoc.Fieldgettext("horaplaneada_1"))
      doc.TimeRange       = Now
      
      doc.Chair           = session.username
      doc.sequencenum     = 1
      
      Call doc.ComputeWithForm(True,False)
      Call session.SetEnvironmentVar("AutoCloseAppointment","1")
      
      Set uidoc = ws.editdocument(True,doc)
      
      'fill the required persons
      Call uidoc.FieldSetText("EnterSendTo", auditado+","+lider+","+observador+","+acompañante+","+tecnico )
      Call uidoc.FieldSetText("Location", "Oficina del Auditado" )
End Sub
0
Comment
Question by:ruedaj
  • 3
6 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
Comment Utility
You want a link to the appointment, but where do you want it? Plus, the appointment hasn't been saved yet, so you can't create the link right now.

> Dim auditado,lider,observador,acompañante,tecnico,coordinadorQA,gerente,jefedepto As String
Only jefedepto will be a String, the rest are Variant variables. In LotusScript, you have to specify each variable separately, either on separate lines or separated by commas, like
      Dim a As String, b As String

A last remark: instead of using uidoc.FieldGetText I prefer to use uidoc.document.GetItemValue. It returns an array of the interpreted values. Example: if the field n1_5_1 is defined as a Date value in the form, instead of
      doc.StartDate       = CDat(uidoc.Fieldgettext("n1_5_1"))
you can use
      doc.StartDate       = uidoc.Document.GetItemValue("n1_5_1")(0)
or the shorthand version
      doc.StartDate       = uidoc.Document.n1_5_1(0)
And you can define a variable of type NotesDocument that contains uidoc.Document, to make it even more readable.
0
 

Author Comment

by:ruedaj
Comment Utility
Sjef thanks for your answer and suggestions

actually The person that use the appointment put the link in manual form but we look for that any people  use the appointment script
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 500 total points
Comment Utility
As I said, the Appointment document has to be saved at least once *before* you can get a link to it. That's only possible if you make some changes in the Appointment form.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
IMHO my answers are correct here.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

13 Experts available now in Live!

Get 1:1 Help Now