ResourceCal is part of Calendar Pack 2, which comprises DayCal2, ResourceCal2, MonthCal2 and NavCal. It is an extended version of the DayCalendar function, allowing bookings to be made for specified resources. Resources need not be people: you can track rooms, vehicles or any other type of resource.
Your layout table occurrence should have a relationship to a table which holds the bookings records. This control automatically filters your relationship by date range, and resource ID's, and any manual filtering (by relationship, or using the WhereFilter override) on these values might have unexpected results.
![]()
| Parameter Name | Description | |
|---|---|---|
| 1 |
displayStartDate |
The first date to show on the calendar. Can be a date in quotes or the name of a field (on either the home or the bookings table) containing the date, or a calculation producing a date. If a field name is used, it is NOT enclosed in quotes. If left blank, and displayNumDays is left at 0, the first date displayed will be today's date. |
|
2 |
displayNumDays |
The number of days to show. The width of each day shown is fixed, so you will see as many days as will fit in the Web Viewer you’ve drawn. Can be a number or the name of a field (on either the home or the bookings table) containing the number of days, or a calculation producing a number. If a field name is used, it is NOT enclosed in quotes. |
|
3 |
resourceIDList |
A return-delimited list of resources or a list of resources and IDs. See "Resource List" example below. Note that your list should contain only the resources which you want to be displayed, not the full list of resources. |
|
4 |
"dateFieldName" |
The field on the bookings table containing the booking date. Must be of type Date. The field name needs to be enclosed in quotes and be the full TO::FieldName form. Note that the field name parameters should not be calc fields if you want to be able to update records. |
|
5 |
"startTimeFieldName" |
The field on the bookings table containing the Start Time of the booking. Must be of type Time. The field name needs to be the full name and enclosed in quotes. |
|
6 |
"durationFieldName" |
The field on the bookings table containing the Duration of the booking. The field name needs to be the full name and enclosed in quotes. As an alternative to duration, you can use the 'EndDateFieldName' override to set an end timestamp field. This makes the calendar search for records much quicker and is recommended where possible, especially for databases with larger record sets. In this case, you can simply leave durationFieldName blank. |
|
7 |
"resourceIDFieldname" |
The field on the bookings table containing the ResourceID to be used for the booking. The field name needs to be the full name and enclosed in quotes. |
|
8 |
"descriptionFieldName" (opt) |
The field on the bookings table containing the Description of the appointment. The field name needs to be the full name and enclosed in quotes. |
|
9 |
"colorFieldname" (opt) |
The field on the bookings table containing the Color to be used for the booking. The field name needs to be the full name and enclosed in quotes. Note that a hex or RGB() value is expected. To associate a color with a resource rather than a booking, create a calculation field on the bookings table, set to the color on the related resource record. For help with colors, refer to the "The Basics: Helpful Information" page |
|
10 |
"titleFieldName" (opt) |
The field on the bookings table containing the Title to be used as the top line of the booking. The field name needs to be the full name and enclosed in quotes. |
|
11 |
actionOnApptSelect (opt) |
The name of the script or a command to run on selection of a booking. (useful for obtaining the record number of the record currently being edited). See Action Parameters below. |
|
12 |
actionOnApptEnter (opt) |
The name of the script or a command to run on entry into a booking. See Action Parameters below. |
|
13 |
actionOnDaySelect (opt) |
The name of the script or a command to run on selection of a day. No script parameter should be used in this case: a script parameter, set to the date selected in format yyyy-mm-dd, is automatically generated. If a different date format is needed, use a script parameter of DateMask=. e.g. "Script=DaySelected|DateMask=d-m-Y". See Action Parameters below. |
Each of the functions in the Calendar Pack have optional Action parameters, allowing you to run a script or set a field when a field is selected. See Action Parameters for details.
There are 2 alternative syntaxes for the resourceID string:
1. Simple values
In this case the ResourceIDlist is just a return separated list of the resources you want displayed, e.g. "Blue Room¶West Room¶Board Room¶"
2. Values with corresponding Record IDs
Two lists, of Values and Record-IDs, preceded by keywords "Values=" and "IDs=" with a pipe character before the "IDs".
"Values={return delimited list of names}|IDs={return delimited list of record IDs}"
Supposing you have a list of resources such as People or Rooms in a related table called "Resources", e.g.
RecID ResourceName1 Blue Room2 West Room3 Board RoomIf you do not want all possible resources displayed, but just a selection, you should create a relationship to limit the records e.g.
"Values="& List(ResourcesToDisplay::ResourceName) &"|IDs="& List(ResourcesToDisplay::RecID)
Using a multi-line key on the left side of the relationship (the layout table) is possible, if you want to filter records that way. There are a few 'gotchas' which are explained on the CalPack2 documentation page.
With some knowledge of Javascript, you can make a number of customizations. For customization of functionality, see the documentation on the new Override Manager for details. For customization of display, see Customizing Calendar Display. For date formats used in Overrides, see Date Formatting.
Comments
Steve Wright (unauthenticated)
Aug 19, 2011
I am unclear on how to apply 'EndDateFieldName' rather than duration, Im either doing it wrong, or it does not work for the resource cal ??
I have left 'durationFieldName' empty and have this in the over-ride :
BlackBoxOverride( "ResourceCal2" ; "js" ; "EndDateFieldName='table::field';")
However, debug tells me "Error: The Duration could not be found"
An example of usage would be appreciated.
Sam Sehnert
Sep 23, 2011
@steve, There was a bug in this which has now been resolved — Your example is correct.
mike parsons (unauthenticated)
Nov 29, 2011
Is it possible to turn the calendar sideways with time along the top and resources vertically, in a many resource environment this is way better. As you view more days the scale compresses along the top much nicer than up and down and most screens are now widescreen, not to mention you get to read a line of text easier along a booking...
Sam Sehnert
Jan 16, 2012
Mike, You should be able to achieve this result with the GanttChartPro function in the ChartPack BlackBox. While its not really a true gantt chart, you can still use that function for this purpose. The only caveat with this option is that you don't get the inline editing of the description, but you might be able to live without that?