Solved

Adding additional columns to calendar view

Posted on 2003-11-24
29
296 Views
Last Modified: 2013-12-18
Hi Guys

Is it possible to show more information in a Calendar view

I would like to add something like this to a location column
D:= @If(StartDate_2 != ""; location; "");
D1:= @If(StartDate_3 != ""; location_1; "");
D2:= @If(StartDate_4 != ""; location_2; "");
D3:= @If(StartDate_5 != ""; location_3; "");

@Trim(D:D1:D2:D3)

Columns 1 and 2 have

d := @If( StartDate = "" | EndDate = ""; ""; @Explode( @TextToTime( @Text(StartDate) + "-" + @Text(EndDate) ) ));
d1 := @If( StartDate_1 = "" | EndDate_1 = ""; ""; @Explode( @TextToTime( @Text(StartDate_1) + "-" + @Text(EndDate_1) ) ));
d2 := @If( StartDate_2 = "" | EndDate_2 = ""; ""; @Explode( @TextToTime( @Text(StartDate_2) + "-" + @Text(EndDate_2) ) ));
d3 := @If( StartDate_3 = "" | EndDate_3 = ""; ""; @Explode( @TextToTime( @Text(StartDate_3) + "-" + @Text(EndDate_3) ) ));
d4 := @If( StartDate_4 = "" | EndDate_4 = ""; ""; @Explode( @TextToTime( @Text(StartDate_4) + "-" + @Text(EndDate_4) ) ));

vac := @TextToTime(@Trim( d:d1 : d2 : d3 : d4 ));

dateRange := @TextToTime(@Replace( @Text(Vac); @Text(holidays); "" ) );


dateRangeTextList := @Explode(dateRange);
dateRangeDateList := @TextToTime(dateRangeTextList);
dayOfWeekNumberList := @Weekday(dateRangeDateList);
dayOfWeekTextList := @Text(dayOfWeekNumberList);
weekEndList := @Replace(dayOfWeekTextList; "2" : "3" : "4" : "5" : "6"; "" : "" : "" : "" : "" : "" + "IS A WEEKDAY");
dateRangeWithComment := dateRangeTextList + weekEndList;
weekDayDates := @Left(dateRangeWithComment; "IS A WEEKDAY");

holidayTextList := @Text(holidays);
workDayDateTextList := @Replace(weekDayDates; holidayTextList; "");
finalTextList := @Trim(workDayDateTextList);
finalDateList := @TextToTime(finalTextList);
finalDateList

Column 3 is RequesterName


James
0
Comment
Question by:adspmo
  • 13
  • 11
  • 5
29 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9814009
Well you can add more columns on the right of 3rd col.. it will show up as popup text in a box.

And also you can concat values in col 3 to show it on view.. anyway it will get truncated due to spacing managed automatically by calendar

~Hemanth
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9815079
Hi adspmo,

Sure, a calendar is like ny other view, once you get past these differences:

1) First few columns are used to control calendar placement (dates, start times, durations)

2) Calendar display formats are not the same -- regular views use a full row per document, calendar views obvisoul break that up using a calendar-based grid

3) Because ofthe "tightness," calendarrs supporta  hover-to-view-the-rest of teh cutoff entry feature.  I don't remember if it only applies to the first visible column, though.

So, like any view, you can create new columns (at the end, or just anywhere past the calendar control columns).  And you can place additional text in an existing column formula to include more text in that column.

You might want to consider using multiple lines per document, which is a view option.  That way, it won't get cut off.

Best regards,
qwaletee
0
 

Author Comment

by:adspmo
ID: 9819453
Hi

I have it showing the info however it is showing in the wrong place
e.g.

Start 25/11/2003  End 28/11/2003    Location YYZ
Start 30/11/2003 End 5/12/2003       Location CCH

etc........

I need to get the Location info spanning the correct dates only
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9819591
Now that is going to be a problem !

In order to matchup the multivalues with prev col data.. it is not possible ! Unless you create record for each start and end dates.

0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9828081
I'm confused.  What's the problem?
0
 

Author Comment

by:adspmo
ID: 9833768
Hi

I wanted to show That I am in Toronto for two days .Paris for a day New York for three days etc..

This is done off a form that has multiple Start and End Dates and Location fields

James
0
 

Author Comment

by:adspmo
ID: 9833781
Also I asked a question about needing to ctreate multiple forms based on these fields having data in them when the original form was saved

http://www.experts-exchange.com/Applications/Email/Lotus_Notes/Q_20803090.html

Maybe we should revisit that idea


James
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9834548
Toronto for two days -- are you using a date range in the calendar date column, or a multiple-value date list field?

The multiple forms is a reasonable, though somehat complicated, idea.  I would simply copy the current form to a new document, make it a response to the original document, add a flag field to indicate that this is a "shadow," (or maybe just change the form), and drop the "lists" down to "singles."  (Start/end dates and "description, which is city.)
0
 

Author Comment

by:adspmo
ID: 9834892
The whole point of this form is that a person can open a single document and in put upto four different date ranges

In the colums I am using a variation of this
d1 := @if( StartDate_1 = "" | EndDate_1 = ""; ""; @Explode( @TextToTime( Text(StartDate_1) + "-" + @Text(EndDate_1) ) ));
d2 := @if( StartDate_2 = "" | EndDate_2 = ""; ""; @Explode( @TextToTime( Text(StartDate_2) + "-" + @Text(EndDate_2) ) ));
d3 := @if( StartDate_3 = "" | EndDate_3 = ""; ""; @Explode( @TextToTime( Text(StartDate_3) + "-" + @Text(EndDate_3) ) ));
d4 := @if( StartDate_4 = "" | EndDate_4 = ""; ""; @Explode( @TextToTime( Text(StartDate_4) + "-" + @Text(EndDate_4) ) ));

@Trim( d1 : d2 : d3 : d4 );


I would like to do whatever gets the jon done. Whether it is response, shadow or a new scripted document doesn' t matter

Whatever is the quickest way and reliable.

James
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9834937
adspmo,
> Whether it is response, shadow or a new scripted document doesn' t matter
How about "all of the above."

These would be "shadow" documents created via script ("scripted documents,") and the particular way they wouuld be created is as response documents.
0
 

Author Comment

by:adspmo
ID: 9838852
Ok

so where do we begin

The new form would have to contain all information that is in the parent , except for the start and end date fields they would be singular. If on the parent the up to 4 date ranges are not empty then a new form for each ot the 4 date ranges would have to be created. Also they would have to show in the calendar views only
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9839328
Don't bother creating a new form.  Re-use the existiong form, but don't allow editing if the shadow flag is present.  In fact, if someone attempts to open the document, redrect him to teh parent document.
0
 

Author Comment

by:adspmo
ID: 9839460
These would be "shadow" documents created via script ("scripted documents,") and the particular way they wouuld be created is as response documents.

I cannot use the existing form because it contains multiple Start and End Dates and they do not show up on the calendar with descriptions properly.

When the original is saved and if
Startdate_1 and EndDate_1, Startdate_2 and EndDate_2, Startdate_3 and EndDate_3, Startdate_4 and EndDate_4 are not empy then a new document must be created showing all the original document info plus only the ,Startdate_1 and EndDate_1 and another for Startdate_2 and EndDate_2 etc... so I can show the relevant location information in the calendar.

James
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9840821
Shadow Doc can be something which is not associated with any form but some virtual form, and it may cause some error while opening and uses default form of the db so you can point it to the form with multiple start and end date in calendar views form formula.

Always reference this shadow doc with original parent document id (or as responses)
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 31

Expert Comment

by:qwaletee
ID: 9844244
I don't see any problem with re-using the form... just make sure, when copying values, that for each document, you "skip" the extra start/end/location lines (i.e., for shadow 1, only copy fields for the first line, for shadow 2, only fields for the second line, etc.)
0
 

Author Comment

by:adspmo
ID: 9847698
I do not know how do this

James
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9850392
In the save or button inlcude this script which does create doc for eact start and end dates

Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
dim s as new notessession
dim db as notesdatabase
dim doc as notesdocument
set db = s.CurrentDatabase
set doc = db.CreateDocument
doc.Form = "Shadow Form"
doc.StartDate = uidoc.Document.StartDate
doc.EndDate = uidoc.Document.EndDate
doc.Subject = uidoc.Document.Subject
doc.Save true, false

0
 

Author Comment

by:adspmo
ID: 9850744
Will I have to modify this for
StartDate_2, StartDate_#.....etc Same for EndDate

James
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9850792
yes
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9850848
This will handle all the dates...

Dim suffixes(1 to 4) as string, startDate as variant, endDate as variant, Subject as string
suffixes(1) = "" 'the first one is just plain StartDate, EndDate, Subject
suffixes(2) = "_1" 'StartDate_1, EndDate_1, Subject_1
suffixes(3) = "_2"
suffixes(4) = "_3"

Dim ws as New NotesUIWorkspace
dim s as new notessession
dim doc as notesdocument
Forall suffix in suffixes
  set doc = ws.currentDocument.Document.copyToDatabase ( s.currentDatabase )
  startDate = doc.getItemValue("StartDate" & suffix)
  endDate = doc.getItemValue("EndDate" & suffix)
  subject = doc.getItemValue("Subject" & suffix)(0)

  Forall dropSuffix in suffixes
    doc.removeItem "StartDate" & dropSuffix
    doc.removeItem "EndDate" & dropSuffix
    doc.removeItem "Subject" & dropSuffix
  End Forall
  doc.shadowFlag = "1"
  doc.StartDate = startDate
  doc.EndDate = endDate
  doc.Subject = subject
  doc.Save true, false
End Forall
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9850860
Oh, and change your form's QueryOpen:

If source.documet.shadowFlag(0) = "1" Then
  continue = false
  end
End If
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9850975
Actually, I misdefined suffixes, and I used SUBJECT instead of location...

Dim suffixes(1 to 5) as string, startDate as variant, endDate as variant, Location as string
suffixes(1) = "" 'the first one is just plain StartDate, EndDate, Location
suffixes(2) = "_2" 'StartDate_1, EndDate_1, Location_1
suffixes(3) = "_3"
suffixes(4) = "_4"
suffixes(5) = "_5"


Dim ws as New NotesUIWorkspace
dim s as new notessession
dim doc as notesdocument
Forall suffix in suffixes
  set doc = ws.currentDocument.Document.copyToDatabase ( s.currentDatabase )
  startDate = doc.getItemValue("StartDate" & suffix)
  endDate = doc.getItemValue("EndDate" & suffix)
  Location = doc.getItemValue("Location" & suffix)(0)

  Forall dropSuffix in suffixes
    doc.removeItem "StartDate" & dropSuffix
    doc.removeItem "EndDate" & dropSuffix
    doc.removeItem "Location" & dropSuffix
  End Forall
  doc.shadowFlag = "1"
  doc.StartDate = startDate
  doc.EndDate = endDate
  doc.Location = Location
  doc.Save true, false
End Forall

0
 

Author Comment

by:adspmo
ID: 9851727
Hi Qwaletee

Where would I put this script you provided

GLobal,Agent ??
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9854843
You could put it in the QuerySave.  That would cause every create or update (which always result in a form save) kicking off the code.  The ws duplicates the Source parameter, but it should all work.

Only one issue: if a document is saved more than once, it produces duplicates, but I can fix that if you like

0
 

Author Comment

by:adspmo
ID: 9859095
Please do I need to get this issue solved,
Also these new dox will need to show in a calendar view. That is the reason I am doing this

James


If it works the bonus points will fly
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9872426
Try this.  I will get around the problem of the duplicates by making the shadows into responses of the main document, and y dleeting any existing responses before creating new shadows.  The calendar view should SELECT shadowFlag = "1"

In QueryOpen:
If Source.document.shadowFlag(0) = "1" Then
  continue = false
  Dim s as new notesSession
  Dim db as notesDatabase
  Set db = s.currentDatabase
  Dim parent as notesDocument
  Set parent = db.getDocumentByUNID(Source.document.parentDocumentUNID)
  Dim ws as new notesUiWorkspace
  ws.editDocument False , parent
End If

In QueySave:

Dim suffixes(1 to 5) as string, startDate as variant, endDate as variant, Location as string
suffixes(1) = "" 'the first one is just plain StartDate, EndDate, Location
suffixes(2) = "_2" 'StartDate_1, EndDate_1, Location_1
suffixes(3) = "_3"
suffixes(4) = "_4"
suffixes(5) = "_5"


Dim ws as New NotesUIWorkspace
dim s as new notessession
Dim main as notesDocument
Set main = ws.currentDocument.Document
main.responses.removeAll True
dim shadow as notesdocument
Forall suffix in suffixes
  set shadow = main.copyToDatabase ( s.currentDatabase )
  shadow.makeresponse main 'sets the new shadow to be a response doc
  startDate = shadow.getItemValue("StartDate" & suffix)
  endDate = shadow.getItemValue("EndDate" & suffix)
  Location = shadow.getItemValue("Location" & suffix)(0)

  Forall dropSuffix in suffixes
    shadow.removeItem "StartDate" & dropSuffix
    shadow.removeItem "EndDate" & dropSuffix
    shadow.removeItem "Location" & dropSuffix
  End Forall
  shadow.shadowFlag = "1"
  shadow.StartDate = startDate
  shadow.EndDate = endDate
  shadow.Location = Location
  shadow.Save true, false
End Forall
0
 

Author Comment

by:adspmo
ID: 9877300
Hi
I get Object variable not set on


If Source.document.shadowFlag(0) = "1" Then

I did add a shadowflag field to the form as text editable default value "0"

james
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 9879766
That's in the QurySave event?  Plese run it throuh the debugger, and check that:

1) Source is a NotesUiDocument
2) Source.document exists, and is a notesDocument

You can also try this instead of If Source.document.shadowFlag(0) = "1" Then

Dim sourceBackEnd as notesDocument
Set sourceBackEnd = Source.document
If sourceBackEnd.shadowFlag(0) = "1" Then

You do NOT need to add ShadowFlag to you form.  The code works perfectly if shadowFlag does not exist.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9884640
Whoa!  Again!

What's cooking, James?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

22 Experts available now in Live!

Get 1:1 Help Now