ResourceCal is part of Calendar Pack 2, which comprises DayCal2, ResourceCal2 and MonthCal2. 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.
ResourceCal2( displayStartDate ; displayNumDays ; resourceIDList ; "dateFieldName" ; "startTimeFieldName" ; "durationFieldName" ; "resourceIDFieldName" {;"descriptionFieldName" ; "colorFieldName"; "titleFieldName" ; "actionOnApptSelect" ; "actionOnApptEnter" ; "actionOnDaySelect" } )
Your layout should have a context of the home table. All the parameters should refer to the related table which holds the bookings records, with the exception of the resourceIDlist, which should refer to the Resource (people, rooms etc) table. Be sure to read the paragraph on zModID below, before setting up your call to this function.
|
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. |
|
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. |
|
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 values, 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 Roomthen to pass these to the calendar, you would create the following calculation for the ResourceIDlist parameter:
"Values="& List(Resources::ResourceName) &"|IDs="& List(Resources::RecID)
Comments