JOBOCCURRENCE

Stores information pertaining to an occurrence of a job.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DESCRIPTION nvarchar(30) Default = '' The name of the job occurrence.
TYPECODE tinyint Default = 0 Indicates the recurrence pattern, if any, for this job occurrence.
STARTDATE datetime yes The date on which this job begins, if it is a one-time occurrence.
ENDDATE datetime yes The date on which this job ends, if it is a one-time occurrence.
STARTMONTHDAY UDT_MONTHDAY Default = '0000' The month and day this job begins, if it is a recurring occurrence.
ENDMONTHDAY UDT_MONTHDAY Default = '0000' The month and day this job ends, if it is a recurring occurrence.
STARTTIME UDT_HOURMINUTE Default = '' The time of day that this job occurrence begins.
ENDTIME UDT_HOURMINUTE Default = '' The time of day that this job occurrence ends.
DAYOFWEEKCODE tinyint Default = 0 The day(s) of the week this job occurrence takes place, if it is an ongoing occurrence.
VOLUNTEERSNEEDED int Default = 0 The number of volunteers required to perform this job occurrence.
COMMENTS nvarchar(max) Default = '' Any additional information pertaining to this job occurrence.
ISACTIVE bit Default = 1 Indicates whether or not this job occurrence is active.
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
TYPE nvarchar(9) (Computed) yes CASE [TYPECODE] WHEN 0 THEN N'One time' WHEN 1 THEN N'Recurring' WHEN 2 THEN N'Ongoing' END Provides a translation for the 'TYPECODE' field.
DAYOFWEEK nvarchar(9) (Computed) yes CASE [DAYOFWEEKCODE] WHEN 0 THEN N'Every day' WHEN 1 THEN N'Sunday' WHEN 2 THEN N'Monday' WHEN 3 THEN N'Tuesday' WHEN 4 THEN N'Wednesday' WHEN 5 THEN N'Thursday' WHEN 6 THEN N'Friday' WHEN 7 THEN N'Saturday' WHEN 8 THEN N'Weekends' WHEN 9 THEN N'Weekdays' END Provides a translation for the 'DAYOFWEEKCODE' field.
ESTIMATEDVALUE money Default = 0 The estimated value per hour for the job occurrence, stored in the job's base currency.
ORGANIZATIONESTIMATEDVALUE money Default = 0 The estimated value per hour for the job occurrence, stored in the organization currency.
RECURRENCESTARTDATE date yes
RECURRENCEENDDATE date yes

Foreign Keys

Foreign Key Field Type Null Notes Description
JOBID uniqueidentifier JOB.ID FK to JOB
DEPARTMENTCODEID uniqueidentifier yes DEPARTMENTCODE.ID The department for whom this occurrence of the job will be performed.
LOCATIONCODEID uniqueidentifier yes VOLUNTEERLOCATIONCODE.ID The location where this occurrence of the job will be performed.
EVENTID uniqueidentifier yes EVENT.ID FK to EVENT
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
SITEID uniqueidentifier yes SITE.ID The site to which this job occurrence belongs.
BASECURRENCYID uniqueidentifier yes CURRENCY.ID The base currency associated with this job occurrence.
ORGANIZATIONEXCHANGERATEID uniqueidentifier yes CURRENCYEXCHANGERATE.ID The exchange rate used to convert base currency amounts to organization amounts.

Indexes

Index Name Fields Unique Primary Clustered
IX_JOBOCCURRENCE_DATEADDED DATEADDED yes
IX_JOBOCCURRENCE_DATECHANGED DATECHANGED
IX_JOBOCCURRENCE_JOBID JOBID
PK_JOBOCCURRENCE ID yes yes

Triggers

Trigger Name Description
TR_JOBOCCURRENCE_INSERTUPDATE_CURRENCY
TR_JOBOCCURRENCE_AUDIT_UPDATE
TR_JOBOCCURRENCE_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHTIMESHEET JOBOCCURRENCEID
EVENTSTAFFRESOURCE JOBOCCURRENCEID
ITINERARYITEMSTAFFRESOURCE JOBOCCURRENCEID
ITINERARYSTAFFRESOURCE JOBOCCURRENCEID
TIMESHEET JOBOCCURRENCEID
VOLUNTEERASSIGNMENT JOBOCCURRENCEID