Solved

How to add a link to  an Appointment via LotusScript

Posted on 2012-03-15
6
14 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
ID: 37728570
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
ID: 37729385
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
ID: 37730466
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
ID: 41666879
IMHO my answers are correct here.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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