DayCal is part of the DayCalendar Pack, which comprises DayCal, ResourceCal and MonthCal. It is an extended version of the DayCalendar function. Extensions to the standard function include the following features:
DayCal( displayStartDate ; displayNumDays ; "dateFieldName" ; "startTimeFieldName" ; "durationFieldName" ; "descriptionFieldName" {; "colorFieldName"; "titleFieldName" ; "actionOnApptSelect" ; "actionOnDaySelect" } )
| 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 related table) containing the date, or a calculation producing a date. If a field name is used, it is NOT enclosed in quotes. |
| 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 related 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 | dateFieldName |
The field on the related table containing the appointment 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. |
| 4 | startTimeFieldName |
The field on the related table containing the Start Time of the appointment. Must be of type Time. The field name needs to be the full name and enclosed in quotes. |
| 5 | durationFieldName |
The field on the related table containing the Duration of the appointment. The field name needs to be the full name and enclosed in quotes. |
| 6 | descriptionFieldName |
The field on the related table containing the Description of the appointment. The field name needs to be the full name and enclosed in quotes. |
| 7 | colorFieldname (opt) |
The field on the related table containing the Color to be used for the appointment. The field name needs to be the full name and enclosed in quotes. Note that a hex or RGB() value is expected. |
| 8 | titleFieldName (opt) |
The field on the related table containing the Title to be used as the top line of the appointment. The field name needs to be the full name and enclosed in quotes. |
| 9 | actionOnApptSelect (opt) |
The name of the script or a command to run on selection of an appointment. (useful for obtaining the record number of the record currently being edited). See note on syntax below. |
| 10 | actionOnDaySelect (opt) |
The name of the script or a command to run on selection of a day. |
The action parameters have a defined syntax as follows:
For a script:
“Script=<script name>”, optionally followed by a vertical pipe and GetField=<fieldname on related table> if the script has a parameter.
Examples: “Script=Get DayCal Value”, or, with optional parameter, “Script=Get DayCal Value|GetField=Duration”. Note that if the optional GetField is left out, it will use the RecordID (as in Get(RecordID) ).
For a command:
“SetField=<field on home table> optionally followed by a vertical pipe and GetField=<fieldname on related table>.
Examples: “SetField=DayCal selected ID|GetField=Duration”. Again, if the optional GetField is left out, it will use the RecordID.
Note that the SetField table is assumed to be the “home” table, while the SetField table is assumed to be the "related" table. Do NOT use full table occurrence names here.
Updates are "animated": you see an appointment moving when you change its date, color or duration.
With some knowledge of Javascript, you can customise the following (defaults are in bold):
Customisation is achieved though the use of a DayCalendarOverride.js file. We suggest you read this blog if you're interested.
Comments