Solved

Script Help

Posted on 2002-07-11
11
177 Views
Last Modified: 2013-12-18
I use the below code to populate my calendar for a vacation database.  However when I look in my calendar only an icon shows up. If I roll my mouse over it then it will say My Name - Vacation - Approved by.  But I want it to display vacation or something without having to place my mouse over it. How would I update this code to do that?
Code is as follows:

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim workspace As New NotesUIWorkspace
     Dim Doc As NotesDocument
     Dim db As NotesDatabase
     Dim UIDoc As NotesUIDocument
     Dim CurDoc As NotesDocument
     Dim servername As String
     Dim user As String
     Dim reg As New NotesRegistration
     Dim regserver As String
     Dim mailserver As String
     Dim mailfile As String
     Dim maildomain As String
     Dim mailsystem As Integer
     Dim profile As String
     
     Set CurDoc = workspace.CurrentDocument.Document
     Set db = session.CurrentDatabase
     servername = db.Server
     user = session.CommonUserName
     reg.RegistrationServer = servername
     
     Call reg.getUserInfo(user, mailserver, mailfile,  maildomain, mailsystem, profile)
     
     Set db = session.GetDatabase(servername,mailfile)
     Set doc = db.CreateDocument
     doc.form = "Appointment"
0
Comment
Question by:schmad01
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
please add the rest of the code.
0
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 65 total points
Comment Utility
Is this the default calendar of your mailfile you are using?
Here's the formula for the info displayed on the calendar view:
xxLocation := @If(@Length(Room); "Location: " + @Name([CN];@Subset(Room;1)); @Length(Location);"Location: " + Location; "");
xxChair := @If(AppointmentType = "3"; "Chair: " + @Name([CN];Chair); TaskType = "2"; "Owner: " + @Name([CN];Chair);"");

@Trim(Subject : xxLocation : xxChair)

From this you can see that you need to specify a subject in your appointment document for this to be displayed on the calendar.
If you also want people to know where you are on vacation, you can specify this in the location field and this too will be displayed on the calendar.

So you would need to include in your script at least the following:
doc.Subject="Vacation"

and optionally you could include:
doc.Location="Sunny California"

Regards,
JM
0
 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
The subject & optional suggestion from zvo is what is missing.

Hi Bro !!!

I wont be around for the next 4 days. You know what the big event is right ? Will write you guys a big email on how things went okay ?  Take it easy bro....
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Bro, take you it not too hard!
You will need your powers for Aruns to come :)
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
Comment Utility
You meant from jerrith, I suppose Arun?
Walking with your head in the clouds allready because your girlfriend is coming over?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
3 years Guys!  Doesn't sound pretty exciting ?

I have personalized gifts, Choclates, A HUGE teddy bear, A LapTop  above all Myself dressed in Full (hee hee hee)

All set to go.  5 more hours and i will be on my way...

As Jerrith pointed out, I am already walking on my head among the clouds.

:-)
0
 

Author Comment

by:schmad01
Comment Utility
Sorry , here is the whole code:

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim workspace As New NotesUIWorkspace
     Dim Doc As NotesDocument
     Dim db As NotesDatabase
     Dim UIDoc As NotesUIDocument
     Dim CurDoc As NotesDocument
     Dim servername As String
     Dim user As String
     Dim reg As New NotesRegistration
     Dim regserver As String
     Dim mailserver As String
     Dim mailfile As String
     Dim maildomain As String
     Dim mailsystem As Integer
     Dim profile As String
     
     Set CurDoc = workspace.CurrentDocument.Document
     Set db = session.CurrentDatabase
     servername = db.Server
     user = session.CommonUserName
     reg.RegistrationServer = servername
     
     Call reg.getUserInfo(user, mailserver, mailfile,  maildomain, mailsystem, profile)
     
     Set db = session.GetDatabase(servername,mailfile)
     Set doc = db.CreateDocument
     doc.form = "Appointment"
     doc.AppointmentType = "2"
     doc.Subject = CurDoc.ReqType(0) & "--" & CurDoc.Name(0) & ". (Approved by " &  CurDoc.Manager(0) & ") "
     doc.StartDate = CurDoc.StartDate1(0)
     doc.Duration = CurDoc.CalDays(0)
     doc.ExcludeFromView = "D"
     Set UIDoc = Workspace.EditDocument(True,doc)
     Set doc = UIDoc.Document
     doc.StartDate = CurDoc.StartDate(0)
     doc.EndDate = CurDoc.EndDate(0)
     Call uidoc.Reload
End Sub
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
Comment Utility
Hm, I don't quite understand what you are trying to do here.
First you create a new document:
set doc=db.CreateDocument
Then you set the correct fields and afterwards you reassign the value of doc:
set doc=UIDoc.Document

However you never saved the new document, so logically no info is included there!!

Before you change the reference to another document, save it using
Call doc.Save(True,False)

so the fragement of your code would be:

    Set db = session.GetDatabase(servername,mailfile)
    Set doc = db.CreateDocument
    doc.form = "Appointment"
    doc.AppointmentType = "2"
    doc.Subject = CurDoc.ReqType(0) & "--" & CurDoc.Name(0) & ". (Approved by " &  CurDoc.Manager(0) & ") "
    doc.StartDate = CurDoc.StartDate1(0)
    doc.Duration = CurDoc.CalDays(0)
    doc.ExcludeFromView = "D"
    'First save your changes, before you reassign the document!
    'The reference doc is a background document and not in the UI.
    Call doc.Save(True,False)
    'Before you can use the background document, you need to save it
    Set UIDoc = Workspace.EditDocument(True,doc)
    Set doc = UIDoc.Document
    doc.StartDate = CurDoc.StartDate(0)
    doc.EndDate = CurDoc.EndDate(0)
    Call uidoc.Reload
0
 

Author Comment

by:schmad01
Comment Utility
The code is on a button that is on a vacation document that has already been saved. It gives you the option of putting the information in your calendar. (Notes 5, by the way).
0
 

Author Comment

by:schmad01
Comment Utility
Thanks, Jerrith!
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
Comment Utility
You're welcome. Thanks for the A :-)
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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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.
This video discusses moving either the default database or any database to a new volume.
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.

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