Solved

How to add a link to  an Appointment via LotusScript

Posted on 2012-03-15
6
16 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
[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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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