LETTERTEMPLATE

Stores letter templates and their output format settings in the system .

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(100) Default = '' The name of the letter template.
DESCRIPTION nvarchar(255) Default = '' The description of the letter template.
LETTERFILE varbinary The actual file.
LETTERFILENAME nvarchar(255) Default = '' The file name of the letter template.
LETTERTEMPLATETYPECODE tinyint Default = 0 The type of the letter template.
CUSTOMPARAMETERDATAFORMITEM xml yes Custom parameters for the process.
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.
LETTERTEMPLATETYPE nvarchar(28) (Computed) yes CASE [LETTERTEMPLATETYPECODE] WHEN 0 THEN N'Acknowledgement' WHEN 1 THEN N'Planned gift acknowledgement' WHEN 2 THEN N'Pledge reminder' WHEN 3 THEN N'Receipt' WHEN 4 THEN N'Correspondence' WHEN 5 THEN N'Constituent letter' WHEN 6 THEN N'Tribute acknowledgement' WHEN 7 THEN N'Group sales contract' WHEN 8 THEN N'Membership card' END Provides a translation for the 'LETTERTEMPLATETYPECODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
QUERYVIEWID uniqueidentifier yes QUERYVIEWCATALOG.ID A foreign key to the query view used as output format for this letter.
SITEID uniqueidentifier yes SITE.ID A foreign key to the site table.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
EXPORTDEFINITIONID uniqueidentifier yes EXPORTDEFINITION.ID A foreign key to the export definition table.

Indexes

Index Name Fields Unique Primary Clustered
IX_LETTERTEMPLATE_DATEADDED DATEADDED yes
IX_LETTERTEMPLATE_DATECHANGED DATECHANGED
PK_LETTERTEMPLATE ID yes yes
UC_LETTERTEMPLATE_NAME NAME yes

Triggers

Trigger Name Description
TR_LETTERTEMPLATE_AUDIT_UPDATE
TR_LETTERTEMPLATE_AUDIT_DELETE

Referenced by

Referenced by Field
GROUPSALESDEFAULT CONTRACTLETTERTEMPLATEID
MEMBERSHIPPROGRAM LETTERTEMPLATEID
PRINTMEMBERSHIPCARDSPROCESS LETTERTEMPLATEID