Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script Help

Posted on 2002-07-11
11
Medium Priority
?
192 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
[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
  • 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 260 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
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…
Suggested Courses

650 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