Solved

Script Help

Posted on 2002-07-11
11
180 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
ID: 7148346
please add the rest of the code.
0
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 65 total points
ID: 7148355
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
ID: 7148620
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
ID: 7148681
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
ID: 7148706
You meant from jerrith, I suppose Arun?
Walking with your head in the clouds allready because your girlfriend is coming over?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Expert Comment

by:Arunkumar
ID: 7149177
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
ID: 7150807
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
ID: 7153500
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
ID: 7154131
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
ID: 7222331
Thanks, Jerrith!
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 7228243
You're welcome. Thanks for the A :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

912 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

23 Experts available now in Live!

Get 1:1 Help Now