[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to add a link to  an Appointment via LotusScript

Posted on 2012-03-15
6
Medium Priority
?
20 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 2000 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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