Calendar Fields
A calendar field shows records from several queries on one calendar, by day, week, month, year or as a list. Each query is a layer with its own color. Click a layer's name to hide or show it.
The Calendar Page
xAssets comes with a Calendar page in the Maintenance menu. It appears while Maintenance is switched on in Enable/Disable Features. Its layers are:
| Layer | Shows |
|---|---|
| Schedules | Scheduled transformations, each time they run |
| Incidents | Service desk incidents |
| Maintenance | Work orders |
| Purchase Orders | Order and delivery dates |
| Contracts | Contract end and notice dates |
| Leases | Lease start and end dates |

Click an entry to open its record. A schedule opens the schedule, and a purchase order opens the purchase order.
Adding a Calendar to a Form
The calendar field is set up by xAssets or your partner. It is not in the Field Type list. Once it is on a form, its QueryString property names the layers:
sources: Calendar Incidents|Calendar Maintenance
view: month
| Setting | Meaning |
|---|---|
sources |
The queries to show, by name or ID, separated by |. At most 12. Use names. |
view |
The view it opens on: day, week, month, year or list. The browser remembers each user's last choice. |
date |
Optional. The date it opens on, as yyyy-MM-dd |
A layer's name is the query name without a leading "Calendar ".
Writing a Layer Query
A layer is a saved query. The calendar reads its columns by name:
| Column | Meaning |
|---|---|
CalendarStart |
When the entry starts. Required |
CalendarEnd |
When it ends. Leave it out for an entry at one point in time |
CalendarTitle |
The words on the entry |
CalendarKey |
The ID of the record to open. The query's Subject says which kind of record |
CalendarDetail |
More words for the tooltip |
CalendarColour |
A color for this row, as #rgb or #rrggbb |
CalendarRepeat |
Seconds, Minutes, Hours, Days, Weeks or Months, to repeat the entry from CalendarStart |
CalendarEvery |
The number of units between repeats. 1 when blank |
The dates on screen arrive as the parameters %CalendarStartDate% and %CalendarEndDate%. Filter on them so the query reads only the period shown, and list them in User Supplied Values. An entry with no time of day is an all-day entry.
Each layer reads at most 2,000 entries for the period on screen. When a layer has more, a note on its name says so.
Related Articles
- Calendar View -- any query on a calendar, with no layer query
- Advanced Field Types -- the other fields set up by xAssets
- Query Parameters -- parameters in a query