STEWARDSHIPPLANSTEP

Contains stewardship plan steps.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
OBJECTIVE nvarchar(100) Default = ''
TARGETDATE datetime
DATELOCKED bit Default = 0 Indicates whether or not the Target Date is locked.
ACTUALDATE datetime yes
TEMPLATE nvarchar(100) Default = '' Name of the template from which this step was copied.
RECURSCODE tinyint Default = 0 0=Single Occurrence, 1=Annually, 2=Semi-Annually, 3=Quarterly, 4=Bi-Monthly, 5=Monthly, 6=Semi-Monthly, 7=Bi-Weekly, 8=Weekly
STARTDATE datetime yes
ENDDATE datetime yes
STATUSCODE tinyint Default = 0 0=Pending, 1=Completed, 2=Cancelled, 3=Declined
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.
RECURS nvarchar(17) (Computed) yes CASE [RECURSCODE] WHEN 0 THEN N'Single Occurrence' WHEN 1 THEN N'Annually' WHEN 2 THEN N'Semi-Annually' WHEN 3 THEN N'Quarterly' WHEN 4 THEN N'Bi-Monthly' WHEN 5 THEN N'Monthly' WHEN 6 THEN N'Semi-Monthly' WHEN 7 THEN N'Bi-Weekly' WHEN 8 THEN N'Weekly' END Provides a translation for the 'RECURSCODE' field.
TARGETSTARTTIME UDT_HOURMINUTE Default = '' Target starting time of the plan step.
TARGETENDTIME UDT_HOURMINUTE Default = '' Target ending time of the plan step.
ISALLDAYEVENT bit Default = 1 Flags this plan step as all day.
ACTUALSTARTTIME UDT_HOURMINUTE Default = '' Actual starting time of the plan step.
ACTUALENDTIME UDT_HOURMINUTE Default = '' Actual ending time of the plan step.
ISINTERACTION int (Computed) case when CONTACTMETHODCODEID is null then 0 else 1 end
DATE datetime (Computed) yes coalesce(ACTUALDATE,TARGETDATE)
STATUS nvarchar(9) (Computed) yes CASE [STATUSCODE] WHEN 0 THEN N'Pending' WHEN 1 THEN N'Completed' WHEN 2 THEN N'Cancelled' WHEN 3 THEN N'Declined' END Provides a translation for the 'STATUSCODE' field.
COMPLETED int (Computed) case when STATUSCODE in (1,2,3) then 1 else 0 end
TARGETSTARTDATETIME datetime (Computed) yes dateadd(mi, convert(tinyint, substring(TARGETSTARTTIME, 3, 2)), dateadd(hh, convert(tinyint, substring(TARGETSTARTTIME, 1, 2)), convert(datetime, convert(date, TARGETDATE)))) The target start date and time of the plan step.
TARGETENDDATETIME datetime (Computed) yes dateadd(mi, convert(tinyint, substring(TARGETENDTIME, 3, 2)), dateadd(hh, convert(tinyint, substring(TARGETENDTIME, 1, 2)), convert(datetime, convert(date, TARGETDATE)))) The target end date and time of the plan step.
ACTUALSTARTDATETIME datetime (Computed) yes dateadd(mi, convert(tinyint, substring(ACTUALSTARTTIME, 3, 2)), dateadd(hh, convert(tinyint, substring(ACTUALSTARTTIME, 1, 2)), convert(datetime, convert(date, ACTUALDATE)))) The actual start date and time of the plan step.
ACTUALENDDATETIME datetime (Computed) yes dateadd(mi, convert(tinyint, substring(ACTUALENDTIME, 3, 2)), dateadd(hh, convert(tinyint, substring(ACTUALENDTIME, 1, 2)), convert(datetime, convert(date, ACTUALDATE)))) The actual end date and time of the plan step.
STARTTIME char(4) (Computed) yes coalesce((case when ACTUALSTARTTIME = '' then null else ACTUALSTARTTIME end),TARGETSTARTTIME)
ENDTIME char(4) (Computed) yes coalesce((case when ACTUALENDTIME = '' then null else ACTUALENDTIME end) ,TARGETENDTIME)

Foreign Keys

Foreign Key Field Type Null Notes Description
PLANID uniqueidentifier STEWARDSHIPPLAN.ID FK to STEWARDSHIPPLAN
CATEGORYCODEID uniqueidentifier yes STEWARDSHIPSTEPCATEGORYCODE.ID FK to STEWARDSHIPSTEPCATEGORYCODE
CONTACTPERSONID uniqueidentifier yes CONSTITUENT.LOCALID FK to CONSTITUENT
CONTACTMETHODCODEID uniqueidentifier yes INTERACTIONTYPECODE.ID FK to INTERACTIONTYPECODE
CONSTITUENTID uniqueidentifier yes CONSTITUENT.LOCALID The ID of the constituent that this step has been assigned to.
BENEFITID uniqueidentifier yes BENEFIT.ID FK to BENEFIT
EVENTID uniqueidentifier yes EVENT.ID FK to EVENT
MAILINGID uniqueidentifier yes MKTSEGMENTATION.ID FK to MKTSEGMENTATION
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
TIMEZONEENTRYID uniqueidentifier yes TIMEZONEENTRY.ID Time zone of meeting time.

Indexes

Index Name Fields Unique Primary Clustered
IX_STEWARDSHIPPLANSTEP_CONSTITUENTID CONSTITUENTID
IX_STEWARDSHIPPLANSTEP_CONTACTPERSONID CONTACTPERSONID
IX_STEWARDSHIPPLANSTEP_DATEADDED DATEADDED yes
IX_STEWARDSHIPPLANSTEP_DATECHANGED DATECHANGED
PK_STEWARDSHIPPLANSTEP ID yes yes

Triggers

Trigger Name Description
TR_STEWARDSHIPPLANSTEP_AUDIT_UPDATE
TR_STEWARDSHIPPLANSTEP_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHSTEWARDSHIPPLANSTEPUPDATE PRIMARYRECORDID
EXCHANGECALENDARITEMBATCH STEWARDSHIPSTEPID
STEWARDSHIPATTACHMENT STEPID
STEWARDSHIPEXCHANGECALENDARITEM STEPID
STEWARDSHIPMEDIALINK STEPID
STEWARDSHIPNOTE STEPID
STEWARDSHIPPLANSTEPPARTICIPANT STEWARDSHIPPLANSTEPID
STEWARDSHIPSTEPASSOCIATEDPLAN STEPID