MYOB Exo Business CRM
List of entities
Entity details
Entity: CAMPAIGN
CommentThis table contains details of all marketing campaigns in EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the campaign.
TITLENoVARCHAR(60)NoA title/description for the campaign.
REFERENCENoVARCHAR(15)NoA short, user-defined reference code for the campaign.
DESCRIPTNoVARCHAR(5000)NoAny notes entered for the campaign.
OWNERNoINTEGERNoThe ID number of the staff member who is assigned as the campaign's owner.
CREATEDATENoDATETIMENoThe date the campaign was created on.
STARTDATENoDATETIMENoThe Start Date specified for the campaign.
LAST_UPDATEDNoDATETIMENoThe date that the campaign was last edited on.
ENDDATENoDATETIMENoThe End Date specified for the campaign.
CAMPAIGN_STAGENoINTEGERNoThe ID number of the Stage specified for the campaign, from the CAMPAIGN_STAGE table.
EST_COSTNoFLOAT(53)NoThe Estimated Cost entered for the campaign.
EST_REVENUENoFLOAT(53)NoThe Estimated Revenue amount entered for the campaign.
EST_RESPONSENoFLOAT(53)NoThe Estimated Response entered for the campaign.
CAMPAIGN_TYPENoINTEGERYesThe ID number of the Type specified for the campaign, from the CAMPAIGN_TYPE table.
JOB_LINKNoINTEGERNoIf campaign costs are being tracked by linking the campaign to a job in the EXO Job Costing system, the linked job's ID number is recorded here.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_CAMPAIGN_CONTACT_LISTSNon IdentifyingCAMPAIGNCAMPAIGN_CONTACT_LISTSZero Or More
CAMPAIGN_CAMPAIGN_HISTNon IdentifyingCAMPAIGNCAMPAIGN_HISTZero Or More
CAMPAIGN_CAMPAIGN_WAVENon IdentifyingCAMPAIGNCAMPAIGN_WAVEZero Or More
CAMPAIGN_STAGE_CAMPAIGNNon IdentifyingCAMPAIGN_STAGECAMPAIGNZero Or More
CAMPAIGN_TASKSNon IdentifyingCAMPAIGNTASKSZero Or More
CAMPAIGN_TYPE_CAMPAIGNNon IdentifyingCAMPAIGN_TYPECAMPAIGNZero Or More
STAFF_CAMPAIGNNon IdentifyingSTAFFCAMPAIGNZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CAMPAIGN_TYPE)
Not NullColumn ConstraintNOT NULL (SEQNO)
CAMPAIGN_STAGE_CAMPAIGNForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_STAGE) REFERENCES CAMPAIGN_STAGE(SEQNO)
CAMPAIGN_TYPE_CAMPAIGNForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_TYPE) REFERENCES CAMPAIGN_TYPE(SEQNO)
DF__CAMPAIGN__CAMPAI__1CE8C54DDefaultColumn ConstraintCAMPAIGN_STAGE DEFAULT 0
DF__CAMPAIGN__CAMPAI__20B95631DefaultColumn ConstraintCAMPAIGN_TYPE DEFAULT 1
DF__CAMPAIGN__CREATE__19183469DefaultColumn ConstraintCREATEDATE DEFAULT getdate()
DF__CAMPAIGN__ENDDAT__1BF4A114DefaultColumn ConstraintENDDATE DEFAULT getdate()
DF__CAMPAIGN__EST_CO__1DDCE986DefaultColumn ConstraintEST_COST DEFAULT 0
DF__CAMPAIGN__EST_RE__1ED10DBFDefaultColumn ConstraintEST_REVENUE DEFAULT 0
DF__CAMPAIGN__EST_RE__1FC531F8DefaultColumn ConstraintEST_RESPONSE DEFAULT 0
DF__CAMPAIGN__JOB_LI__21AD7A6ADefaultColumn ConstraintJOB_LINK DEFAULT -1
DF__CAMPAIGN__LAST_U__1B007CDBDefaultColumn ConstraintLAST_UPDATED DEFAULT getdate()
DF__CAMPAIGN__STARTD__1A0C58A2DefaultColumn ConstraintSTARTDATE DEFAULT getdate()
PK__CAMPAIGN__C8320F98172FEBF7Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_CAMPAIGNForeign KeyTable ConstraintFOREIGN KEY (OWNER) REFERENCES STAFF(STAFFNO)



Entity: CAMPAIGN_CONTACT_LISTS
CommentThis table contains records of the contact lists that are assigned to campaigns.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNONoINTEGERYesA unique ID number for the record.
CAMPAIGN_SEQNONoINTEGERYesThe ID number of the campaign that the contact list is assigned to.
CONTACT_LIST_SEQNONoINTEGERYesThe ID number of the contact list that is assigned to the campaign.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_CAMPAIGN_CONTACT_LISTSNon IdentifyingCAMPAIGNCAMPAIGN_CONTACT_LISTSZero Or More
CONTACT_LIST_CAMPAIGN_CONTACT_LISTSNon IdentifyingCONTACT_LISTCAMPAIGN_CONTACT_LISTSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CONTACT_LIST_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (CAMPAIGN_SEQNO)
CAMPAIGN_CAMPAIGN_CONTACT_LISTSForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_SEQNO) REFERENCES CAMPAIGN(SEQNO)
CONTACT_LIST_CAMPAIGN_CONTACT_LISTSForeign KeyTable ConstraintFOREIGN KEY (CONTACT_LIST_SEQNO) REFERENCES CONTACT_LIST(SEQNO)



Entity: CAMPAIGN_HIST
CommentThis table contains details of History Notes on campaigns.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the History Note.
CAMPAIGN_SEQNONoINTEGERYesThe ID number of the campaign that the History Note is attached to.
SALESNONoINTEGERNoThe ID number of the staff member who entered the History Note.
TRANSDATENoDATETIMENoThe date and time that the History Note was created on.
SUBJECTNoVARCHAR(80)NoThe subject line of the History Note.
NOTENoVARCHAR(4096)NoThe body of the History Note.
OUTLOOK_LINKNoVARCHAR(40)NoIf the History Note was emailed, this field contains a link to the email in MS Outlook.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_CAMPAIGN_HISTNon IdentifyingCAMPAIGNCAMPAIGN_HISTZero Or More
STAFF_CAMPAIGN_HISTNon IdentifyingSTAFFCAMPAIGN_HISTZero Or More

Indexes:
NameIndex columnsIndex type
CAMPAIGN_HIST_INDEXCAMPAIGN_SEQNO ASC

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CAMPAIGN_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
CAMPAIGN_CAMPAIGN_HISTForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_SEQNO) REFERENCES CAMPAIGN(SEQNO)
DF__CAMPAIGN___TRANS__48C7478BDefaultColumn ConstraintTRANSDATE DEFAULT getdate()
PK__CAMPAIGN__C8320F9846DEFF19Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_CAMPAIGN_HISTForeign KeyTable ConstraintFOREIGN KEY (SALESNO) REFERENCES STAFF(STAFFNO)



Entity: CAMPAIGN_STAGE
CommentThis table records details of the Campaign Stages that are assigned to campaigns in EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the campaign stage.
DESCRIPTNoVARCHAR(60)NoThe stage's name/description.
STATUSKEYNoCHAR(1)NoA one-character code for the stage.
ADMIN_STATNoCHAR(1)YesIf this field is set to 'Y', the campaign stage does not allow the entry of new transactions.
LOCK_CAMPAIGNNoCHAR(1)YesIf this field is set to 'Y', the campaign stage makes campaigns locked, i.e. read-only.
ISARCHIVEDNoCHAR(1)YesIf this field is set to 'Y', campaigns at this stage will be archived.
ISCOMPLETENoCHAR(1)YesIf this field is set to 'Y', campaigns at this stage are complete.
ISACTIVENoCHAR(1)YesIf this field is set to 'Y', campaigns at this stage are active.
WORKFLOW_CONSTRAINEDNoCHAR(1)YesIf this field is set to 'Y', workflow constraints (defined in the CAMPAIGN_STAGE_CONSTRAINT) apply to the campaign stage.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_STAGE_CAMPAIGNNon IdentifyingCAMPAIGN_STAGECAMPAIGNZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (WORKFLOW_CONSTRAINED)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (ADMIN_STAT)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (LOCK_CAMPAIGN)
Not NullColumn ConstraintNOT NULL (ISCOMPLETE)
Not NullColumn ConstraintNOT NULL (ISARCHIVED)
DF__CAMPAIGN___ADMIN__26722F87DefaultColumn ConstraintADMIN_STAT DEFAULT N
DF__CAMPAIGN___ISACT__2A42C06BDefaultColumn ConstraintISACTIVE DEFAULT N
DF__CAMPAIGN___ISARC__285A77F9DefaultColumn ConstraintISARCHIVED DEFAULT N
DF__CAMPAIGN___ISCOM__294E9C32DefaultColumn ConstraintISCOMPLETE DEFAULT N
DF__CAMPAIGN___LOCK___276653C0DefaultColumn ConstraintLOCK_CAMPAIGN DEFAULT N
DF__CAMPAIGN___WORKF__2B36E4A4DefaultColumn ConstraintWORKFLOW_CONSTRAINED DEFAULT N
PK__CAMPAIGN__C8320F982489E715Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: CAMPAIGN_STAGE_CONSTRAINT
CommentThis table contains details of Campaign Stage workflow constraints.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the constraint.
ISACTIVENoCHAR(1)YesIf this field contains 'Y', the constraint applies, so that users are permitted to change a campaign from the stage specified by the FROM_STATUS to the stage specified by the TO_STATUS.
FROM_STATUSNoCHAR(1)NoThe source stage for the constraint.
TO_STATUSNoCHAR(1)NoThe destination stage for the constraint.
DESCRIPTIONNoVARCHAR(50)YesA description of the constraint.
SHORTDESCNoVARCHAR(5)YesA short code (5 characters max) for the constraint.
TRACKEVENTNoCHAR(1)NoIf this field contains 'Y', when a campaign is changed from the FROM_STATUS to the TO_STATUS, the stage change is recorded in the Event Log.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SHORTDESC)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
DF__CAMPAIGN___ISACT__2FFB99C1DefaultColumn ConstraintISACTIVE DEFAULT N
PK__CAMPAIGN__C8320F982E13514FPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: CAMPAIGN_TYPE
CommentThis table contains details of the campaign types used by campaigns in EXO CRM.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNONoINTEGERYesA unique ID number for the campaign type.
DESCRIPTNoVARCHAR(60)NoThe campaign type's name/description.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_TYPE_CAMPAIGNNon IdentifyingCAMPAIGN_TYPECAMPAIGNZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)



Entity: CAMPAIGN_WAVE
CommentThis table contains details of all campaign waves setup in EXO Business CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the campaign wave.
WAVE_NONoINTEGERNoAn ID number that uniquely identifies the campaign wave within the campaign.
CAMPAIGN_SEQNONoINTEGERYesThe ID number of the campaign that the campaign wave is part of.
DESCRIPTNoVARCHAR(50)NoA short written description of the campaign wave.
STARTDATENoDATETIMENoThe start date for the period that the campaign wave runs over.
ENDDATENoDATETIMENoThe end date for the period that the campaign wave runs over.
COMMUNICATION_METHODNoINTEGERNoThis field specifies the Communication Method selected for the campaign wave. Will be one of:
0 = no Communication Method selected
1 = Mailshot Process
2 = Bulk Activity Creation
3 = Execute SQL
4 = Social Media Post
5 = Export List
6 = Execute External Program
TRACKER_KEYNoVARCHAR(150)NoFor campaign waves with the "Mailshot Process" Communication Method, this field contains any text entered into the Tracker ID field.
OPT_IN_URLNoVARCHAR(150)NoFor campaign waves with the "Mailshot Process" Communication Method, this field contains any text entered into the Opt in URL field.
OPT_OUT_URLNoVARCHAR(150)NoFor campaign waves with the "Mailshot Process" Communication Method, this field contains any text entered into the Opt out URL field.
LANDING_SITENoVARCHAR(150)NoFor campaign waves with the "Mailshot Process" Communication Method, this field contains any text entered into the Landing site field.
PROCESSEDNoCHAR(1)NoThis field is set to 'Y' if the campaign wave's Processed flag is ticked.
COMPLETENoCHAR(1)NoThis field is set to 'Y' if the campaign wave's Complete flag is ticked.
DOC_BATCH_HDR_SEQNONoINTEGERNoFor campaign waves with the "Mailshot Process " Communication Method that include email attachments, this field contains the ID number of the documentation batch in the DOC_BATCH_HDR table that relates to the attachments.
SOCIAL_MEDIA_TEXTNoVARCHAR(500)NoFor campaign waves with the "Social Media Post" Communication Method, this field contains the text that is posted to the social media network(s).
FACEBOOK_POST_IDNoVARCHAR(100)NoFor campaign waves with the "Social Media Post" Communication Method, this field contains the ID number of the Facebook post.
TWITTER_POST_IDNoVARCHAR(100)NoFor campaign waves with the "Social Media Post" Communication Method, this field contains the ID number of the Twitter post.
LINKEDIN_POST_DATENoDATETIMENoFor campaign waves with the "Social Media Post" Communication Method, this field contains the date of the LinkedIn post.
SETTINGSNoVARCHAR(4096)NoThis field is used by campaign waves where the Communication Method is "Execute SQL" or "Execute External Program".

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_CAMPAIGN_WAVENon IdentifyingCAMPAIGNCAMPAIGN_WAVEZero Or More
CAMPAIGN_WAVE_CAMPAIGN_WAVE_AUDITNon IdentifyingCAMPAIGN_WAVECAMPAIGN_WAVE_AUDITZero Or More
CAMPAIGN_WAVE_CAMPAIGN_WAVE_CONTACT_LISTSNon IdentifyingCAMPAIGN_WAVECAMPAIGN_WAVE_CONTACT_LISTSZero Or More
CAMPAIGN_WAVE_CONTACTSNon IdentifyingCAMPAIGN_WAVECONTACTSZero Or More
CAMPAIGN_WAVE_DR_PRICESNon IdentifyingCAMPAIGN_WAVEDR_PRICESZero Or More
CAMPAIGN_WAVE_DR_PRICE_POLICYNon IdentifyingCAMPAIGN_WAVEDR_PRICE_POLICYZero Or More
CAMPAIGN_WAVE_DR_TRANSNon IdentifyingCAMPAIGN_WAVEDR_TRANSZero Or More
CAMPAIGN_WAVE_JOBCOST_HDRNon IdentifyingCAMPAIGN_WAVEJOBCOST_HDRZero Or More
CAMPAIGN_WAVE_OPPORTUNITYNon IdentifyingCAMPAIGN_WAVEOPPORTUNITYZero Or More
CAMPAIGN_WAVE_SALESORD_HDRNon IdentifyingCAMPAIGN_WAVESALESORD_HDRZero Or More
CAMPAIGN_WAVE_TASKSNon IdentifyingCAMPAIGN_WAVETASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CAMPAIGN_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
CAMPAIGN_CAMPAIGN_WAVEForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_SEQNO) REFERENCES CAMPAIGN(SEQNO)
DF__CAMPAIGN___COMMU__4C97D86FDefaultColumn ConstraintCOMMUNICATION_METHOD DEFAULT 0
DF__CAMPAIGN___COMPL__4E8020E1DefaultColumn ConstraintCOMPLETE DEFAULT N
DF__CAMPAIGN___DOC_B__4F74451ADefaultColumn ConstraintDOC_BATCH_HDR_SEQNO DEFAULT 0
DF__CAMPAIGN___ENDDA__4BA3B436DefaultColumn ConstraintENDDATE DEFAULT getdate()
DF__CAMPAIGN___PROCE__4D8BFCA8DefaultColumn ConstraintPROCESSED DEFAULT N
DF__CAMPAIGN___START__4AAF8FFDDefaultColumn ConstraintSTARTDATE DEFAULT getdate()
PK__CAMPAIGN__C8320F98708B2022Primary KeyTable ConstraintPRIMARY KEY (SEQNO)

Triggers:
Trigger nameCode
CAMPAIGN_WAVE_PROCESSEDCREATE TRIGGER [dbo].[CAMPAIGN_WAVE_PROCESSED]
ON [dbo].[CAMPAIGN_WAVE]
FOR UPDATE
AS
BEGIN
DECLARE @FLATLIST AS VARCHAR(500),
@CAMPAIGN_SEQNO INT,
@WAVENO INT,
@CAMPAIGN_WAVE_SEQNO INT,
@SALESNO INT,
@TRANSDATE DATETIME,
@DESCRIPT VARCHAR(50),
@SUBJECT VARCHAR(100),
@NOTE VARCHAR(255),
@COMM_MESSAGE VARCHAR(255),
@PROCESSED CHAR(1),
@COMPLETE CHAR(1),
@CAMPAIGN_WAVE_TYPE VARCHAR(100),
@INTERACTIONS INT,
@WAS_PROCESSED CHAR(1),
@COMMUNICATION_METHOD CHAR(1),
@OLD_SOCIAL_MEDIA_TEXT VARCHAR(500),
@OLD_FACEBOOK_POST_ID VARCHAR(100),
@OLD_LINKEDIN_POST_DATE DATETIME,
@OLD_TWITTER_POST_ID VARCHAR(100),
@FACEBOOK_POST_ID VARCHAR(100),
@TWITTER_POST_ID VARCHAR(100),
@LINKEDIN_POST_DATE DATETIME

SET @FLATLIST ='' /*FLATLIST builds a comma separated list of the CONTACT_LIST.names used in this Campaign Wave*/
SET @WAS_PROCESSED = (SELECT PROCESSED from DELETED)
SET @SALESNO = [dbo].FN_GET_STAFF_NO()

SELECT
@OLD_SOCIAL_MEDIA_TEXT = ISNULL(SOCIAL_MEDIA_TEXT, ''),
@OLD_FACEBOOK_POST_ID = ISNULL(FACEBOOK_POST_ID, ''),
@OLD_LINKEDIN_POST_DATE = ISNULL(LINKEDIN_POST_DATE, 0),
@OLD_TWITTER_POST_ID = ISNULL(TWITTER_POST_ID, ''),
@WAS_PROCESSED = PROCESSED
FROM DELETED

SELECT
@CAMPAIGN_WAVE_SEQNO = SEQNO,
@CAMPAIGN_SEQNO = CAMPAIGN_SEQNO,
@WAVENO = WAVE_NO,
@DESCRIPT = DESCRIPT,
@TRANSDATE = GETDATE(),
@PROCESSED = PROCESSED,
@COMPLETE = COMPLETE,
@COMMUNICATION_METHOD = COMMUNICATION_METHOD,
@OLD_SOCIAL_MEDIA_TEXT = SOCIAL_MEDIA_TEXT,
@FACEBOOK_POST_ID = FACEBOOK_POST_ID,
@LINKEDIN_POST_DATE = LINKEDIN_POST_DATE,
@TWITTER_POST_ID = TWITTER_POST_ID
FROM INSERTED

IF @COMMUNICATION_METHOD <> '4' AND @PROCESSED = 'Y' AND @WAS_PROCESSED <> 'Y'
BEGIN
-- Get interaction count
IF @COMMUNICATION_METHOD = '2' /*BULK TASK INSERT*/
SELECT @INTERACTIONS=ISNULL(COUNT(*), 0)
FROM TASKS WITH (NOLOCK)
WHERE CAMPAIGN_WAVE_SEQNO = @CAMPAIGN_WAVE_SEQNO
ELSE
SELECT @INTERACTIONS=ISNULL(COUNT(*), 0)
FROM CAMPAIGN_WAVE_AUDIT CWA WITH (NOLOCK)
WHERE CWA.CAMPAIGN_WAVE_SEQNO = @CAMPAIGN_WAVE_SEQNO

SELECT @FLATLIST = ISNULL(@FLATLIST, '') + ', ' + TITLE
FROM CONTACT_LIST CL
WHERE CL.SEQNO IN (SELECT CONTACT_LIST_SEQNO
FROM CAMPAIGN_WAVE_CONTACT_LISTS WITH (NOLOCK)
WHERE CAMPAIGN_WAVE_SEQNO = @CAMPAIGN_WAVE_SEQNO)
SELECT @COMM_MESSAGE =
CASE
WHEN @COMMUNICATION_METHOD = '1' THEN 'Mailshot Processed' -- Mailshot
WHEN @COMMUNICATION_METHOD = '2' THEN 'Bulk Activity Processed' -- Bulk Activity Creation
WHEN @COMMUNICATION_METHOD = '3' THEN 'Execute SQL Processed' -- Execute SQL
WHEN @COMMUNICATION_METHOD = '5' THEN 'Export List Processed' -- Export List
WHEN @COMMUNICATION_METHOD = '6' THEN 'Executed External Program' -- Execute External Program
ELSE ''
END

SET @NOTE = 'List(s) Used : ' + SUBSTRING(@FLATLIST, 3, LEN(@FLATLIST))+ ' '+CAST(@INTERACTIONS AS VARCHAR(100))+' Interactions'

SET @SUBJECT='Wave '+ LTRIM(STR(@WAVENO, 2)) + ' ' + @COMM_MESSAGE + '-' + @DESCRIPT
INSERT INTO CAMPAIGN_HIST (CAMPAIGN_SEQNO, SALESNO, TRANSDATE, SUBJECT, NOTE)
VALUES (@CAMPAIGN_SEQNO, @SALESNO, @TRANSDATE, @SUBJECT, @NOTE)
END /*IF PROCESSED*/
ELSE IF @COMMUNICATION_METHOD = '4' -- Social Media Post
BEGIN
SELECT @COMM_MESSAGE =
CASE
WHEN @OLD_FACEBOOK_POST_ID <> @FACEBOOK_POST_ID THEN 'Facebook wall post'
WHEN @OLD_LINKEDIN_POST_DATE <> @LINKEDIN_POST_DATE THEN 'LinkedIn activity'
WHEN @OLD_TWITTER_POST_ID <> @TWITTER_POST_ID THEN 'Twitter status update'
ELSE ''
END

IF @COMM_MESSAGE <> ''
BEGIN
SET @SUBJECT='Wave '+ LTRIM(STR(@WAVENO, 2)) + ' ' + @COMM_MESSAGE --+ '-' + @DESCRIPT
SET @NOTE = @OLD_SOCIAL_MEDIA_TEXT
INSERT INTO CAMPAIGN_HIST (CAMPAIGN_SEQNO, SALESNO, TRANSDATE, SUBJECT, NOTE)
VALUES (@CAMPAIGN_SEQNO, @SALESNO, @TRANSDATE, @SUBJECT, @NOTE)
END
END
END


Entity: CAMPAIGN_WAVE_AUDIT
CommentThis table contains a record of which Contacts each campaign wave was sent to.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNONoINTEGERYesA unique ID number for the audit line.
CAMPAIGN_WAVE_SEQNONoINTEGERYesThe ID number of the campaign wave.
CONTACT_SEQNONoINTEGERYesThe ID number of the Contact that the wave was sent to.
LOGDATETIMENoDATETIMEYesThe date and time that the campaign wave was sent.
COMMUNICATION_METHODNoINTEGERNoThe campaign wave's communication method. Will be one of:
0 = no Communication Method selected
1 = Mailshot Process
2 = Bulk Activity Creation
3 = Execute SQL
4 = Social Media Post
5 = Export List
6 = Execute External Program
EXECUTE_TYPENoVARCHAR(15)NoHow communication was sent to the contact - "EMAILED" or "PRINTED".

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_WAVE_CAMPAIGN_WAVE_AUDITNon IdentifyingCAMPAIGN_WAVECAMPAIGN_WAVE_AUDITZero Or More
CONTACTS_CAMPAIGN_WAVE_AUDITNon IdentifyingCONTACTSCAMPAIGN_WAVE_AUDITZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (LOGDATETIME)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (CAMPAIGN_WAVE_SEQNO)
Not NullColumn ConstraintNOT NULL (CONTACT_SEQNO)
CAMPAIGN_WAVE_CAMPAIGN_WAVE_AUDITForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
CONTACTS_CAMPAIGN_WAVE_AUDITForeign KeyTable ConstraintFOREIGN KEY (CONTACT_SEQNO) REFERENCES CONTACTS(SEQNO)
DF__CAMPAIGN___COMMU__5B7007ABDefaultColumn ConstraintCOMMUNICATION_METHOD DEFAULT 0
DF__CAMPAIGN___LOGDA__5EB688AADefaultColumn ConstraintLOGDATETIME DEFAULT getdate()

Triggers:
Trigger nameCode
AFTER_ADD_CAMPAIGN_WAVE_AUDITCREATE TRIGGER [dbo].[AFTER_ADD_CAMPAIGN_WAVE_AUDIT]
ON [dbo].[CAMPAIGN_WAVE_AUDIT]
FOR INSERT
AS
BEGIN
SET NOCOUNT ON
INSERT INTO CONTACT_HIST
(CONTACT_SEQNO, POSTTIME, TRANSDATE, NOTE, [SUBJECT], ACTIONDUEDATE, SALESNO)
SELECT
CWA.[CONTACT_SEQNO],
GETDATE(),
CWA.[LOGDATETIME],
C.TITLE+'-'+CW.DESCRIPT+' '+CP.DESCRIPT,
C.TITLE+'-'+CP.DESCRIPT,
GETDATE(),
[DBO].FN_GET_STAFF_NO()
FROM INSERTED CWA /*[dbo].[CAMPAIGN_WAVE_AUDIT]*/
JOIN CAMPAIGN_WAVE CW ON CW.SEQNO = CWA.CAMPAIGN_WAVE_SEQNO AND CW.COMMUNICATION_METHOD <> 1
JOIN CAMPAIGN C ON CW.CAMPAIGN_SEQNO = C.SEQNO
JOIN COMMUNICATION_PROCESSES CP ON CP.SEQNO=CW.COMMUNICATION_METHOD
SET NOCOUNT OFF
END


Entity: CAMPAIGN_WAVE_CONTACT_LISTS
CommentThis table contains records of the contact lists that are used by campaign waves.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNONoINTEGERYesA unique ID number for the record.
CAMPAIGN_WAVE_SEQNONoINTEGERYesThe ID number of the campaign wave that uses the list.
CONTACT_LIST_SEQNONoINTEGERYesThe ID number of the contact list that is used by the campaign wave.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_WAVE_CAMPAIGN_WAVE_CONTACT_LISTSNon IdentifyingCAMPAIGN_WAVECAMPAIGN_WAVE_CONTACT_LISTSZero Or More
CONTACT_LIST_CAMPAIGN_WAVE_CONTACT_LISTSNon IdentifyingCONTACT_LISTCAMPAIGN_WAVE_CONTACT_LISTSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (CONTACT_LIST_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (CAMPAIGN_WAVE_SEQNO)
CAMPAIGN_WAVE_CAMPAIGN_WAVE_CONTACT_LISTSForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
CONTACT_LIST_CAMPAIGN_WAVE_CONTACT_LISTSForeign KeyTable ConstraintFOREIGN KEY (CONTACT_LIST_SEQNO) REFERENCES CONTACT_LIST(SEQNO)



Entity: CONTACTS
CommentThis table contains information about Contacts.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique identifier for the Contact record.
SALUTATIONNoVARCHAR(4)NoThe Contact's preferred salutation, e.g. Mr, Mrs.
FIRSTNAMENoVARCHAR(30)NoThe Contact's first name.
LASTNAMENoVARCHAR(30)NoThe Contact's last/family name.
TITLENoVARCHAR(30)NoThe Contact's job title.
MOBILENoVARCHAR(30)NoThe Contact's mobile phone number.
DIRECTPHONENoVARCHAR(30)NoThe Contact's direct telephone number.
DIRECTFAXNoVARCHAR(30)NoThe Contact's fax number.
HOMEPHONENoVARCHAR(30)NoThe Contact's home phone number.
EMAILNoVARCHAR(60)NoThe Contact's email address.
NOTESNoVARCHAR(4096)NoAll notes entered for the Contact on the Notes tab.
ADDRESS1NoVARCHAR(30)NoPostal address line 1.
ADDRESS2NoVARCHAR(30)NoPostal address line 2.
ADDRESS3NoVARCHAR(30)NoPostal address line 3.
ADDRESS4NoVARCHAR(30)NoPostal address line 4.
ADDRESS5NoVARCHAR(30)NoPostal address line 5. This line is only available on the Contacts window if the Additional Postal Address Row profile setting is enabled.
POST_CODENoVARCHAR(12)NoThe Contact's post code.
DELADDR1NoVARCHAR(30)NoDelivery address line 1.
DELADDR2NoVARCHAR(30)NoDelivery address line 2.
DELADDR3NoVARCHAR(30)NoDelivery address line 3.
DELADDR4NoVARCHAR(30)NoDelivery address line 4.
DELADDR5NoVARCHAR(30)NoDelivery address line 5.
DELADDR6NoVARCHAR(30)NoDelivery address line 6.
ISACTIVENoCHAR(1)NoWhether the Contact is active (Y) or inactive (N).
ADVERTSOURCENoINTEGERNoThe Contact's Advertising Source - corresponds to the SEQNO of the type in the ADVERT_TYPES table.
SALESNONoINTEGERNoThe STAFFNO of staff member who is set as the Sales person for the Contact.
FULLNAMENoASNoThe Contact's full name, formed by joining the FIRSTNAME and LASTNAME fields.
COMPANY_ACCNONoINTEGERNoIf the Contact is associated with a company (Debtor, Creditor or Non Account) the company's ID number is recorded here.
COMPANY_ACCTYPENoINTEGERNoIf the Contact is associated with a company (Debtor, Creditor or Non Account) the type of company account is recorded here:
1 = Debtor account
2 = Creditor account
3 = Non Account
MSN_IDNoVARCHAR(45)NoThe Contact's MSN ID number.
YAHOO_IDNoVARCHAR(45)NoThe Contact's Yahoo! ID number.
SKYPE_IDNoVARCHAR(45)NoThe Contact's Skype ID number.
LAST_UPDATEDNoDATETIMENoThe date and time when the Contact record was last updated.
SUB1NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 1 is ticked on the Marketing tab.
SUB2NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 2 is ticked on the Marketing tab.
SUB3NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 3 is ticked on the Marketing tab.
SUB4NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 4 is ticked on the Marketing tab.
SUB5NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 5 is ticked on the Marketing tab.
SUB6NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 6 is ticked on the Marketing tab.
SUB7NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 7 is ticked on the Marketing tab.
SUB8NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 8 is ticked on the Marketing tab.
SUB9NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 9 is ticked on the Marketing tab.
SUB10NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 10 is ticked on the Marketing tab.
SUB11NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 11 is ticked on the Marketing tab.
SUB12NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 12 is ticked on the Marketing tab.
SUB13NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 13 is ticked on the Marketing tab.
SUB14NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 14 is ticked on the Marketing tab.
SUB15NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 15 is ticked on the Marketing tab.
SUB16NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 16 is ticked on the Marketing tab.
SUB17NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 17 is ticked on the Marketing tab.
SUB18NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 18 is ticked on the Marketing tab.
SUB19NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 19 is ticked on the Marketing tab.
SUB20NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 20 is ticked on the Marketing tab.
SUB21NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 21 is ticked on the Marketing tab.
SUB22NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 22 is ticked on the Marketing tab.
SUB23NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 23 is ticked on the Marketing tab.
SUB24NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 24 is ticked on the Marketing tab.
SUB25NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 25 is ticked on the Marketing tab.
SUB26NoCHAR(1)NoThis field is set to 'Y' if Marketing Class number 26 is ticked on the Marketing tab.
SYNC_CONTACTSNoCHAR(1)YesThis field is set to 'Y' if the Contact is set to sync with Microsoft Outlook.
LINKEDINNoVARCHAR(20)NoThe Contact's LinkedIn account ID.
TWITTERNoVARCHAR(500)NoThe Contact's Twitter username.
FACEBOOKNoVARCHAR(500)NoThe Contact's Facebook username or ID number.
OPTOUT_EMARKETINGNoCHAR(1)NoThis field is set to 'Y' if the Contact's Opt-Out eMarketing flag is ticked. Contacts who have opted out of eMarketing will not be included in campaign waves for campaigns whose Campaign Type is set to "Marketing" (EXO Business CRM).
CAMPAIGN_WAVE_SEQNONoINTEGERNoIf the Contact is included in a campaign wave (EXO Business CRM), the wave's ID number is stored here.
LATITUDENoFLOAT(53)NoThe Contact's latitude.
LONGITUDENoFLOAT(53)NoThe Contact's longitude.
GEOCODE_STATUSNoINTEGERNoResult of the geocode lookup. Will be one of:
Null or -1 - lookup not yet attempted
0 - lookup successful
>0 - lookup failed

Relationships:
NameRelationship typeParentChildCardinality
ADVERT_TYPES_CONTACTSNon IdentifyingADVERT_TYPESCONTACTSZero Or More
CAMPAIGN_WAVE_CONTACTSNon IdentifyingCAMPAIGN_WAVECONTACTSZero Or More
CONTACTS_CAMPAIGN_WAVE_AUDITNon IdentifyingCONTACTSCAMPAIGN_WAVE_AUDITZero Or More
CONTACTS_CONTACT_LIST_ITEMNon IdentifyingCONTACTSCONTACT_LIST_ITEMZero Or More
CONTACTS_CR_CONTACTSNon IdentifyingCONTACTSCR_CONTACTSZero Or More
CONTACTS_CR_CONT_HISTNon IdentifyingCONTACTSCR_CONT_HISTZero Or More
CONTACTS_CR_TRANSNon IdentifyingCONTACTSCR_TRANSZero Or More
CONTACTS_DR_CONTACTSNon IdentifyingCONTACTSDR_CONTACTSZero Or More
CONTACTS_TASKSNon IdentifyingCONTACTSTASKSZero Or More
STAFF_CONTACTSNon IdentifyingSTAFFCONTACTSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SYNC_CONTACTS)
Not NullColumn ConstraintNOT NULL (SEQNO)
ADVERT_TYPES_CONTACTSForeign KeyTable ConstraintFOREIGN KEY (ADVERTSOURCE) REFERENCES ADVERT_TYPES(SEQNO)
CAMPAIGN_WAVE_CONTACTSForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
DF__CONTACTS__ADVERT__08C105B8DefaultColumn ConstraintADVERTSOURCE DEFAULT 0
DF__CONTACTS__CAMPAI__5AE5F7C6DefaultColumn ConstraintCAMPAIGN_WAVE_SEQNO DEFAULT -1
DF__CONTACTS__ISACTI__74BA0D0BDefaultColumn ConstraintISACTIVE DEFAULT Y
DF__CONTACTS__LAST_U__6C3AA0FADefaultColumn ConstraintLAST_UPDATED DEFAULT getdate()
DF__CONTACTS__OPTOUT__5250B1C5DefaultColumn ConstraintOPTOUT_EMARKETING DEFAULT N
DF__CONTACTS__SALESN__09B529F1DefaultColumn ConstraintSALESNO DEFAULT 0
DF__CONTACTS__SUB10__348057BCDefaultColumn ConstraintSUB10 DEFAULT N
DF__CONTACTS__SUB11__3668A02EDefaultColumn ConstraintSUB11 DEFAULT N
DF__CONTACTS__SUB12__3850E8A0DefaultColumn ConstraintSUB12 DEFAULT N
DF__CONTACTS__SUB13__3A393112DefaultColumn ConstraintSUB13 DEFAULT N
DF__CONTACTS__SUB14__3C217984DefaultColumn ConstraintSUB14 DEFAULT N
DF__CONTACTS__SUB15__3E09C1F6DefaultColumn ConstraintSUB15 DEFAULT N
DF__CONTACTS__SUB16__3FF20A68DefaultColumn ConstraintSUB16 DEFAULT N
DF__CONTACTS__SUB17__41DA52DADefaultColumn ConstraintSUB17 DEFAULT N
DF__CONTACTS__SUB18__43C29B4CDefaultColumn ConstraintSUB18 DEFAULT N
DF__CONTACTS__SUB19__45AAE3BEDefaultColumn ConstraintSUB19 DEFAULT N
DF__CONTACTS__SUB1__2355CBBADefaultColumn ConstraintSUB1 DEFAULT N
DF__CONTACTS__SUB20__47932C30DefaultColumn ConstraintSUB20 DEFAULT N
DF__CONTACTS__SUB21__497B74A2DefaultColumn ConstraintSUB21 DEFAULT N
DF__CONTACTS__SUB22__4B63BD14DefaultColumn ConstraintSUB22 DEFAULT N
DF__CONTACTS__SUB23__4D4C0586DefaultColumn ConstraintSUB23 DEFAULT N
DF__CONTACTS__SUB24__4F344DF8DefaultColumn ConstraintSUB24 DEFAULT N
DF__CONTACTS__SUB25__511C966ADefaultColumn ConstraintSUB25 DEFAULT N
DF__CONTACTS__SUB26__5304DEDCDefaultColumn ConstraintSUB26 DEFAULT N
DF__CONTACTS__SUB2__253E142CDefaultColumn ConstraintSUB2 DEFAULT N
DF__CONTACTS__SUB3__27265C9EDefaultColumn ConstraintSUB3 DEFAULT N
DF__CONTACTS__SUB4__290EA510DefaultColumn ConstraintSUB4 DEFAULT N
DF__CONTACTS__SUB5__2AF6ED82DefaultColumn ConstraintSUB5 DEFAULT N
DF__CONTACTS__SUB6__2CDF35F4DefaultColumn ConstraintSUB6 DEFAULT N
DF__CONTACTS__SUB7__2EC77E66DefaultColumn ConstraintSUB7 DEFAULT N
DF__CONTACTS__SUB8__30AFC6D8DefaultColumn ConstraintSUB8 DEFAULT N
DF__CONTACTS__SUB9__32980F4ADefaultColumn ConstraintSUB9 DEFAULT N
DF__CONTACTS__SYNC_C__657894D2DefaultColumn ConstraintSYNC_CONTACTS DEFAULT Y
PK__CONTACTS__73C5E8D2Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_CONTACTSForeign KeyTable ConstraintFOREIGN KEY (SALESNO) REFERENCES STAFF(STAFFNO)



Entity: CONTACT_LIST
CommentThis table contains details of the contact lists used by EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the contact list.
TITLENoVARCHAR(60)NoThe contact list's name.
DESCRIPTNoVARCHAR(1000)NoThe text entered into the contact list's Notes field.
CONTACT_LIST_TYPENoINTEGERNoThe ID number of the contact list's List Type, taken from CONTACT_LIST_TYPE.
IS_PRIVATENoCHAR(1)NoThis field contains 'Y' if the contact list is private, i.e. only available to its owner (see the OWNER field).
IS_ACTIVENoCHAR(1)NoThis field contains 'Y' if the contact list is active.
CREATED_BYNoINTEGERYesThe ID number of the staff member who created the contact list.
CREATEDATENoDATETIMEYesThe date when the contact list was created.
LAST_MODIFIEDNoDATETIMEYesThe date when the contact list was last edited.
SETTINGSNoVARCHAR(max)NoSQL settings used by the contact list.
OWNERNoINTEGERYesThe ID number of the staff member who is designated as the contact list's owner.

Relationships:
NameRelationship typeParentChildCardinality
CONTACT_LIST_CAMPAIGN_CONTACT_LISTSNon IdentifyingCONTACT_LISTCAMPAIGN_CONTACT_LISTSZero Or More
CONTACT_LIST_CAMPAIGN_WAVE_CONTACT_LISTSNon IdentifyingCONTACT_LISTCAMPAIGN_WAVE_CONTACT_LISTSZero Or More
CONTACT_LIST_CONTACT_LIST_ITEMNon IdentifyingCONTACT_LISTCONTACT_LIST_ITEMZero Or More
CONTACT_LIST_TYPE_CONTACT_LISTNon IdentifyingCONTACT_LIST_TYPECONTACT_LISTZero Or More
STAFF_CONTACT_LISTNon IdentifyingSTAFFCONTACT_LISTZero Or More
STAFF_CONTACT_LIST1Non IdentifyingSTAFFCONTACT_LISTZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (OWNER)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (LAST_MODIFIED)
Not NullColumn ConstraintNOT NULL (CREATEDATE)
Not NullColumn ConstraintNOT NULL (CREATED_BY)
CONTACT_LIST_TYPE_CONTACT_LISTForeign KeyTable ConstraintFOREIGN KEY (CONTACT_LIST_TYPE) REFERENCES CONTACT_LIST_TYPE(SEQNO)
DF__CONTACT_L__CONTA__34C04EDEDefaultColumn ConstraintCONTACT_LIST_TYPE DEFAULT 0
DF__CONTACT_L__CREAT__379CBB89DefaultColumn ConstraintCREATED_BY DEFAULT 0
DF__CONTACT_L__CREAT__3890DFC2DefaultColumn ConstraintCREATEDATE DEFAULT getdate()
DF__CONTACT_L__IS_AC__36A89750DefaultColumn ConstraintIS_ACTIVE DEFAULT Y
DF__CONTACT_L__IS_PR__35B47317DefaultColumn ConstraintIS_PRIVATE DEFAULT N
DF__CONTACT_L__LAST___398503FBDefaultColumn ConstraintLAST_MODIFIED DEFAULT getdate()
DF__CONTACT_L__OWNER__3A792834DefaultColumn ConstraintOWNER DEFAULT 0
PK__CONTACT___C8320F9832D8066CPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_CONTACT_LISTForeign KeyTable ConstraintFOREIGN KEY (CREATED_BY) REFERENCES STAFF(STAFFNO)
STAFF_CONTACT_LIST1Foreign KeyTable ConstraintFOREIGN KEY (OWNER) REFERENCES STAFF(STAFFNO)



Entity: CONTACT_LIST_ITEM
CommentThis table contains details of the members of the contact lists used by EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the record.
HDR_SEQNONoINTEGERYesThe ID number of the contact list (CONTACT_LIST.SEQNO).
ITEM_TYPENoINTEGERYesThe type of item.
1 = Contact
ITEM_SEQNONoINTEGERNoThe item's ID number. For contacts, this is CONTACTS.SEQNO.
QUERY_INSERTEDNoCHAR(1)NoThis field contains 'Y' if the item was added to the list using a query on the List Building Criteria tab of the Contact Lists window; it contains 'N' if the item was added manually.

Relationships:
NameRelationship typeParentChildCardinality
CONTACTS_CONTACT_LIST_ITEMNon IdentifyingCONTACTSCONTACT_LIST_ITEMZero Or More
CONTACT_LIST_CONTACT_LIST_ITEMNon IdentifyingCONTACT_LISTCONTACT_LIST_ITEMZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ITEM_TYPE)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (HDR_SEQNO)
CONTACTS_CONTACT_LIST_ITEMForeign KeyTable ConstraintFOREIGN KEY (ITEM_SEQNO) REFERENCES CONTACTS(SEQNO)
CONTACT_LIST_CONTACT_LIST_ITEMForeign KeyTable ConstraintFOREIGN KEY (HDR_SEQNO) REFERENCES CONTACT_LIST(SEQNO)
DF__CONTACT_L__HDR_S__3F3DDD51DefaultColumn ConstraintHDR_SEQNO DEFAULT -1
DF__CONTACT_L__ITEM___4032018ADefaultColumn ConstraintITEM_TYPE DEFAULT -1
DF__CONTACT_L__QUERY__412625C3DefaultColumn ConstraintQUERY_INSERTED DEFAULT N
PK__CONTACT___C8320F983D5594DFPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)

Triggers:
Trigger nameCode
AFTER_ADD_CONTACTLISTCREATE TRIGGER [dbo].[AFTER_ADD_CONTACTLIST] ON [dbo].[CONTACT_LIST_ITEM]
FOR INSERT
AS
BEGIN
SET NOCOUNT ON
 INSERT INTO CONTACT_HIST
 (CONTACT_SEQNO, POSTTIME, TRANSDATE, NOTE, SUBJECT, ACTIONDUEDATE, SALESNO)
 SELECT I.ITEM_SEQNO, GETDATE(), GETDATE(),
 'Contact List : ' + CL.TITLE + char(13)+Char(10) + 'Added on : ' + CONVERT (varchar, GETDATE()) , 'Added to Contact List', GETDATE(), dbo.FN_GET_STAFF_NO()
 FROM CONTACT_LIST CL
 JOIN INSERTED I ON CL.SEQNO = I.HDR_SEQNO
SET NOCOUNT OFF
END
AFTER_DELETE_CONTACTLISTCREATE TRIGGER [dbo].[AFTER_DELETE_CONTACTLIST] ON [dbo].[CONTACT_LIST_ITEM]
FOR DELETE
AS
BEGIN
SET NOCOUNT ON
 INSERT INTO CONTACT_HIST
 (CONTACT_SEQNO, POSTTIME, TRANSDATE, NOTE, SUBJECT, ACTIONDUEDATE, SALESNO)
 SELECT D.ITEM_SEQNO, GETDATE(), GETDATE(),
 'Contact List : ' + CL.TITLE + char(13)+Char(10) + 'Deleted on : ' + CONVERT (varchar, GETDATE()) , 'Deleted from Contact List', GETDATE(), dbo.FN_GET_STAFF_NO()
 FROM CONTACT_LIST CL
 JOIN DELETED D ON CL.SEQNO = D.HDR_SEQNO
SET NOCOUNT OFF
END


Entity: CONTACT_LIST_TYPE
CommentThis table contains details of the List Types used by contact lists in EXO CRM.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNONoINTEGERYesA unique ID number for the type.
DESCRIPTNoVARCHAR(60)NoThe name/description of the type.

Relationships:
NameRelationship typeParentChildCardinality
CONTACT_LIST_TYPE_CONTACT_LISTNon IdentifyingCONTACT_LIST_TYPECONTACT_LISTZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)



Entity: CRM_BUDGET
CommentThis table contains details of Sales Team Budgets in EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesThe ID number of the budget record.
NAMENoVARCHAR(1024)YesThe period name.
HEADER_SEQNONoINTEGERYesThe ID number of the budget this line belongs to (links to CRM_BUDGET_HDR.SEQNO)
MANREP_PERIOD_SEQNONoINTEGERYesThe ID number of the period as set up in EXO Business Analytics (links to MANREP_PERIOD.PERIOD_SEQNO).
ACTUAL_PERIOD_STATUS_SEQNONoINTEGERNoThe ID number of the corresponding period in the current year, as set up in EXO Business Config (links to PERIOD_STATUS.SEQNO).
LYACTUAL_PERIOD_STATUS_SEQNONoINTEGERNoThe ID number of the corresponding period last year, as set up in EXO Business Config (links to PERIOD_STATUS.SEQNO).
STARTDATENoDATETIMENoThe start date of the period.
ENDDATENoDATETIMENoThe end date of the period.
LEVEL_ACCGROUPNoBITYesThis field contains 1 if the budget applies at the Account Group level; 0 otherwise.
LEVEL_ACCGROUP2NoBITYesThis field contains 1 if the budget applies at the Alternate Account Group level; 0 otherwise.
LEVEL_ACCNONoBITYesThis field contains 1 if the budget applies at the Debtor account level; 0 otherwise.
LEVEL_STOCKGROUPNoBITYesThis field contains 1 if the budget applies at the Stock Group level; 0 otherwise.
LEVEL_STOCKGROUP2NoBITYesThis field contains 1 if the budget applies at the Alternate Stock Group level; 0 otherwise.
LEVEL_STOCKCODENoBITYesThis field contains 1 if the budget applies at the Stock item level; 0 otherwise.
LEVEL_BRANCHNoBITYesThis field contains 1 if the budget applies at the Branch level; 0 otherwise.
LEVEL_STAFFNoBITYesThis field contains 1 if the budget applies at the staff member level; 0 otherwise.
RECALC_LASTRUNNoDATETIMENoThe date and time when the budget was last calculated.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_CRM_BUDGET_HDRNon IdentifyingCRM_BUDGET_HDRCRM_BUDGETZero Or More
FK_CRM_BUDGET_EXCLUDED_ACCGROUP2S_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_ACCGROUP2SZero Or More
FK_CRM_BUDGET_EXCLUDED_ACCGROUPS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_ACCGROUPSZero Or More
FK_CRM_BUDGET_EXCLUDED_BRANCHES_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_BRANCHESZero Or More
FK_CRM_BUDGET_EXCLUDED_DR_ACCS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_DR_ACCSZero Or More
FK_CRM_BUDGET_EXCLUDED_STAFF_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STAFFZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUP2S_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_GROUP2SZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUPS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_GROUPSZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_ITEMSZero Or More
FK_CRM_BUDGET_LINE_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_MANREP_PERIODNon IdentifyingMANREP_PERIODCRM_BUDGETZero Or More
FK_CRM_BUDGET_PERIOD_STATUSNon IdentifyingPERIOD_STATUSCRM_BUDGETZero Or More
FK_CRM_BUDGET_PERIOD_STATUS1Non IdentifyingPERIOD_STATUSCRM_BUDGETZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (LEVEL_STAFF)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (NAME)
Not NullColumn ConstraintNOT NULL (HEADER_SEQNO)
Not NullColumn ConstraintNOT NULL (MANREP_PERIOD_SEQNO)
Not NullColumn ConstraintNOT NULL (LEVEL_ACCGROUP)
Not NullColumn ConstraintNOT NULL (LEVEL_ACCGROUP2)
Not NullColumn ConstraintNOT NULL (LEVEL_ACCNO)
Not NullColumn ConstraintNOT NULL (LEVEL_STOCKGROUP)
Not NullColumn ConstraintNOT NULL (LEVEL_STOCKGROUP2)
Not NullColumn ConstraintNOT NULL (LEVEL_STOCKCODE)
Not NullColumn ConstraintNOT NULL (LEVEL_BRANCH)
FK_CRM_BUDGET_CRM_BUDGET_HDRForeign KeyTable ConstraintFOREIGN KEY (HEADER_SEQNO) REFERENCES CRM_BUDGET_HDR(SEQNO)
FK_CRM_BUDGET_MANREP_PERIODForeign KeyTable ConstraintFOREIGN KEY (MANREP_PERIOD_SEQNO) REFERENCES MANREP_PERIOD(PERIOD_SEQNO)
FK_CRM_BUDGET_PERIOD_STATUSForeign KeyTable ConstraintFOREIGN KEY (ACTUAL_PERIOD_STATUS_SEQNO) REFERENCES PERIOD_STATUS(SEQNO)
FK_CRM_BUDGET_PERIOD_STATUS1Foreign KeyTable ConstraintFOREIGN KEY (LYACTUAL_PERIOD_STATUS_SEQNO) REFERENCES PERIOD_STATUS(SEQNO)
PK_CRM_BUDGETPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: CRM_BUDGET_EXCLUDED_ACCGROUP2S
CommentThis table records any Alternate Account Groups that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
ACCGROUPNoINTEGERYesThe Alternate Account Group ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_ACCGROUP2S_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_ACCGROUP2SZero Or More
FK_CRM_BUDGET_EXCLUDED_ACCGROUP2S_DR_ACCGROUP2SNon IdentifyingDR_ACCGROUP2SCRM_BUDGET_EXCLUDED_ACCGROUP2SZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ACCGROUP)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_ACCGROUP2S_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_ACCGROUP2S_DR_ACCGROUP2SForeign KeyTable ConstraintFOREIGN KEY (ACCGROUP) REFERENCES DR_ACCGROUP2S(ACCGROUP)



Entity: CRM_BUDGET_EXCLUDED_ACCGROUPS
CommentThis table records any Account Groups that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
ACCGROUPNoINTEGERYesThe Account Group ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_ACCGROUPS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_ACCGROUPSZero Or More
FK_CRM_BUDGET_EXCLUDED_ACCGROUPS_DR_ACCGROUPSNon IdentifyingDR_ACCGROUPSCRM_BUDGET_EXCLUDED_ACCGROUPSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ACCGROUP)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_ACCGROUPS_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_ACCGROUPS_DR_ACCGROUPSForeign KeyTable ConstraintFOREIGN KEY (ACCGROUP) REFERENCES DR_ACCGROUPS(ACCGROUP)



Entity: CRM_BUDGET_EXCLUDED_BRANCHES
CommentThis table records any branches that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
BRANCHNONoINTEGERYesThe branch ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_BRANCHES_BRANCHESNon IdentifyingBRANCHESCRM_BUDGET_EXCLUDED_BRANCHESZero Or More
FK_CRM_BUDGET_EXCLUDED_BRANCHES_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_BRANCHESZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (BRANCHNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_BRANCHES_BRANCHESForeign KeyTable ConstraintFOREIGN KEY (BRANCHNO) REFERENCES BRANCHES(BRANCHNO)
FK_CRM_BUDGET_EXCLUDED_BRANCHES_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)



Entity: CRM_BUDGET_EXCLUDED_DR_ACCS
CommentThis table records any Debtor accounts that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
ACCNONoINTEGERYesThe Debtor account ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_DR_ACCS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_DR_ACCSZero Or More
FK_CRM_BUDGET_EXCLUDED_DR_ACCS_DR_ACCSNon IdentifyingDR_ACCSCRM_BUDGET_EXCLUDED_DR_ACCSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ACCNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_DR_ACCS_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_DR_ACCS_DR_ACCSForeign KeyTable ConstraintFOREIGN KEY (ACCNO) REFERENCES DR_ACCS(ACCNO)



Entity: CRM_BUDGET_EXCLUDED_STAFF
CommentThis table records any staff members who are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
STAFFNONoINTEGERYesThe staff member ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STAFF_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STAFFZero Or More
FK_CRM_BUDGET_EXCLUDED_STAFF_STAFFNon IdentifyingSTAFFCRM_BUDGET_EXCLUDED_STAFFZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (STAFFNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_STAFF_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_STAFF_STAFFForeign KeyTable ConstraintFOREIGN KEY (STAFFNO) REFERENCES STAFF(STAFFNO)



Entity: CRM_BUDGET_EXCLUDED_STOCK_GROUP2S
CommentThis table records any Stock Groups that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
GROUPNONoINTEGERYesThe Alternate Stock Group ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUP2S_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_GROUP2SZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUP2S_STOCK_GROUP2SNon IdentifyingSTOCK_GROUP2SCRM_BUDGET_EXCLUDED_STOCK_GROUP2SZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (GROUPNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUP2S_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUP2S_STOCK_GROUP2SForeign KeyTable ConstraintFOREIGN KEY (GROUPNO) REFERENCES STOCK_GROUP2S(GROUPNO)



Entity: CRM_BUDGET_EXCLUDED_STOCK_GROUPS
CommentThis table records any Alternate Stock Groups that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
GROUPNONoINTEGERYesThe Stock Group ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUPS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_GROUPSZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUPS_STOCK_GROUPSNon IdentifyingSTOCK_GROUPSCRM_BUDGET_EXCLUDED_STOCK_GROUPSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (GROUPNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUPS_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_GROUPS_STOCK_GROUPSForeign KeyTable ConstraintFOREIGN KEY (GROUPNO) REFERENCES STOCK_GROUPS(GROUPNO)



Entity: CRM_BUDGET_EXCLUDED_STOCK_ITEMS
CommentThis table records any Stock items that are excluded from Sales Team Budgets.
Primary key columns

Attributes:
Column namePrimary keyData typeNot NULLComment
BUDGET_SEQNONoINTEGERYesThe ID number of the budget (Links to CRM_BUDGET.SEQNO).
STOCKCODENoVARCHAR(23)YesThe Stock item ID to be excluded when generating budgets.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_EXCLUDED_STOCK_ITEMSZero Or More
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_STOCK_ITEMSNon IdentifyingSTOCK_ITEMSCRM_BUDGET_EXCLUDED_STOCK_ITEMSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (STOCKCODE)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_EXCLUDED_STOCK_ITEMS_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)



Entity: CRM_BUDGET_HDR
CommentThis table contains header information for Sales Team Budgets in EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the budget record.
NAMENoVARCHAR(1024)YesThe budget's name.
MANREP_PERIOD_SEQNONoINTEGERYesThe ID number of the Sales Year that the budget belongs to (Sales Years are set up using the EXO Business Analytics module).
ISPRIMARYNoBITYesThis field is set to 1 if the budget is a primary budget; 0 otherwise.
ISACTIVENoBITYesThis field is set to 1 if the budget is active or 0 if it is inactive.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_CRM_BUDGET_HDRNon IdentifyingCRM_BUDGET_HDRCRM_BUDGETZero Or More
FK_CRM_BUDGET_HDR_MANREP_PERIODNon IdentifyingMANREP_PERIODCRM_BUDGET_HDRZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (NAME)
Not NullColumn ConstraintNOT NULL (MANREP_PERIOD_SEQNO)
Not NullColumn ConstraintNOT NULL (ISPRIMARY)
DF_CRM_BUDGET_HDR_ISPRIMARYDefaultColumn ConstraintISPRIMARY DEFAULT 0
DF__CRM_BUDGE__ISACT__0175B502DefaultColumn ConstraintISACTIVE DEFAULT 0
FK_CRM_BUDGET_HDR_MANREP_PERIODForeign KeyTable ConstraintFOREIGN KEY (MANREP_PERIOD_SEQNO) REFERENCES MANREP_PERIOD(PERIOD_SEQNO)
PK_CRM_BUDGET_HDRPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: CRM_BUDGET_LINE
CommentThis table contains line information for Sales Team Budgets in EXO CRM.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the budget line record.
BUDGET_SEQNONoINTEGERYesThe ID number of the budget that the line record belongs to.
VALUENoDECIMAL(19, 4)YesThe budget value.
LYACTUALNoDECIMAL(19, 4)NoLast year actuals for the budget line.
ACCGROUPNoINTEGERNoThe ID number of the Account Group that the line applies to (if there is one).
ACCGROUP_EXPANSIONNoBITNo
ACCGROUP2NoINTEGERNoThe ID number of the Alternate Account Group that the line applies to (if there is one).
ACCGROUP2_EXPANSIONNoBITNo
ACCNONoINTEGERNoThe ID number of the Debtor account that the line applies to (if there is one).
ACCNO_EXPANSIONNoBITNo
STOCK_GROUPNONoINTEGERNoThe ID number of the Stock Group that the line applies to (if there is one).
STOCK_GROUPNO_EXPANSIONNoBITNo
STOCK_GROUPNO2NoINTEGERNoThe ID number of the Alternate Stock Group that the line applies to (if there is one).
STOCK_GROUPNO2_EXPANSIONNoBITNo
STOCKCODENoVARCHAR(23)NoThe ID number of the Stock item that the line applies to (if there is one).
STOCKCODE_EXPANSIONNoBITNo
BRANCHNONoINTEGERNoThe ID number of the branch that the line applies to (if there is one).
BRANCHNO_EXPANSIONNoBITNo
SALESNONoINTEGERNoThe ID number of the staff member that the line applies to (if there is one).
SALESNO_EXPANSIONNoBITNo
ACTUALNoDECIMAL(19, 4)NoActuals for the budget line.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_LINE_BRANCHESNon IdentifyingBRANCHESCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_CRM_BUDGETNon IdentifyingCRM_BUDGETCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_DR_ACCGROUP2SNon IdentifyingDR_ACCGROUP2SCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_DR_ACCGROUPSNon IdentifyingDR_ACCGROUPSCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_DR_ACCSNon IdentifyingDR_ACCSCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_STAFFNon IdentifyingSTAFFCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_STOCK_GROUP2SNon IdentifyingSTOCK_GROUP2SCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_STOCK_GROUPSNon IdentifyingSTOCK_GROUPSCRM_BUDGET_LINEZero Or More
FK_CRM_BUDGET_LINE_STOCK_ITEMSNon IdentifyingSTOCK_ITEMSCRM_BUDGET_LINEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (VALUE)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (BUDGET_SEQNO)
FK_CRM_BUDGET_LINE_BRANCHESForeign KeyTable ConstraintFOREIGN KEY (BRANCHNO) REFERENCES BRANCHES(BRANCHNO)
FK_CRM_BUDGET_LINE_CRM_BUDGETForeign KeyTable ConstraintFOREIGN KEY (BUDGET_SEQNO) REFERENCES CRM_BUDGET(SEQNO)
FK_CRM_BUDGET_LINE_DR_ACCGROUP2SForeign KeyTable ConstraintFOREIGN KEY (ACCGROUP2) REFERENCES DR_ACCGROUP2S(ACCGROUP)
FK_CRM_BUDGET_LINE_DR_ACCGROUPSForeign KeyTable ConstraintFOREIGN KEY (ACCGROUP) REFERENCES DR_ACCGROUPS(ACCGROUP)
FK_CRM_BUDGET_LINE_DR_ACCSForeign KeyTable ConstraintFOREIGN KEY (ACCNO) REFERENCES DR_ACCS(ACCNO)
FK_CRM_BUDGET_LINE_STAFFForeign KeyTable ConstraintFOREIGN KEY (SALESNO) REFERENCES STAFF(STAFFNO)
FK_CRM_BUDGET_LINE_STOCK_GROUP2SForeign KeyTable ConstraintFOREIGN KEY (STOCK_GROUPNO2) REFERENCES STOCK_GROUP2S(GROUPNO)
FK_CRM_BUDGET_LINE_STOCK_GROUPSForeign KeyTable ConstraintFOREIGN KEY (STOCK_GROUPNO) REFERENCES STOCK_GROUPS(GROUPNO)
FK_CRM_BUDGET_LINE_STOCK_ITEMSForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)
PK_CRM_BUDGET_LINEPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: MANREP_PERIOD
Comment
Primary key columnsPERIOD_SEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
PERIOD_SEQNOYesINTEGERYes
STARTDATENoDATETIMENo
ENDDATENoDATETIMENo
PERIOD_NAMENoVARCHAR(20)No
PARENT_PERIOD_SEQNONoINTEGERNo
CALENDARNoCHAR(1)No

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_HDR_MANREP_PERIODNon IdentifyingMANREP_PERIODCRM_BUDGET_HDRZero Or More
FK_CRM_BUDGET_MANREP_PERIODNon IdentifyingMANREP_PERIODCRM_BUDGETZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (PERIOD_SEQNO)
DF__MANREP_PE__CALEN__61915EA7DefaultColumn ConstraintCALENDAR DEFAULT Y
DF__MANREP_PE__ENDDA__5FA91635DefaultColumn ConstraintENDDATE DEFAULT getdate()
DF__MANREP_PE__PAREN__609D3A6EDefaultColumn ConstraintPARENT_PERIOD_SEQNO DEFAULT 0
DF__MANREP_PE__START__5EB4F1FCDefaultColumn ConstraintSTARTDATE DEFAULT getdate()
PK__MANREP_PERIOD__5DC0CDC3Primary KeyTable ConstraintPRIMARY KEY (PERIOD_SEQNO)



Entity: OPPORTUNITY
CommentThis table contains details of all Opportunities used by the EXO CRM module.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Opportunity.
DESCRIPTIONNoVARCHAR(60)NoDescription text for the Opportunity.
OPPORTUNITY_TYPENoINTEGERNoThe Opportunity's type, taken from OPPORTUNITY_TYPE.SEQNO.
OPPORTUNITY_LEADNoINTEGERNoThe Opportunity's lead source, taken from OPPORTUNITY_LEAD.SEQNO.
OPPORTUNITY_STAGENoINTEGERNoThe Opportunity's stage, taken from OPPORTUNITY_STAGE.SEQNO.
PROBABILITYNoINTEGERNoThe Probability value entered for the Opportunity.
ASSIGNED_TONoINTEGERNoThe ID of the staff member to whom the Opportunity has been assigned.
ASSIGNED_BYNoINTEGERNoThe ID of the staff member who assigned the Opportunity.
COMPANYIDNoVARCHAR(50)NoThe ID number of the company (Debtor, Creditor or Non Account) that the Opportunity is assigned to.
CONTACTSEQNONoINTEGERNoThe ID number of the Contact that the Opportunity is assigned to.
AMOUNTNoFLOAT(53)NoThe quote value for the Opportunity.
START_DATENoDATETIMENoThe start date of the Opportunity.
DETAILSNoVARCHAR(4096)NoAny details or notes entered for the Opportunity.
CREATEDBYNoINTEGERNoThe ID number of the staff member who created the Opportunity.
CREATEDATENoDATETIMENoThe date and time that the Opportunity was created.
MODIFIEDBYNoINTEGERNoThe ID number of the staff member who most recently modified the Opportunity.
MODIFIEDDATENoDATETIMENoThe date and time that the Opportunity was most recently modified.
DUE_DATENoDATETIMENoThe due date for the Opportunity.
CLOSE_DATENoDATETIMENoThe date and time when the Opportunity was changed to Closed status.
IS_CLOSENoASNoSet to 'Y' if the Opportunity has been changed to Closed status.
ESTIMATENoFLOAT(53)YesThe estimated value entered for the Opportunity.
LOST_VALUENoFLOAT(53)YesThe total value of all lost lines on the Opportunity.
CLOSED_VALUENoFLOAT(53)YesThe total value of all closed lines on the Opportunity.
TAXTOTALNoFLOAT(53)YesThe total tax amount on the Opportunity.
TAXROUNDINGNoFLOAT(53)YesThe difference between the tax on the header and the sum of the tax on the individual lines.
CURRENCYNONoINTEGERNoThe ID number of the currency that the Sales Order is in.
EXCHRATENoFLOAT(53)NoThe exchange rate for the currency that the Opportunity is in.
WEIGHTED_VALUENoASNoThe Opportunity's weighted value.
WEIGHTED_ESTIMATENoASNoThe Opportunity's weighted estimate.
CAMPAIGN_WAVE_SEQNONoINTEGERNoIf the Opportunity is associated with a campaign wave (EXO Business CRM), the wave's ID number is stored here.

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_WAVE_OPPORTUNITYNon IdentifyingCAMPAIGN_WAVEOPPORTUNITYZero Or More
OPPORTUNITY_DR_TRANSNon IdentifyingOPPORTUNITYDR_TRANSZero Or More
OPPORTUNITY_JOBCOST_HDRNon IdentifyingOPPORTUNITYJOBCOST_HDRZero Or More
OPPORTUNITY_LEAD_OPPORTUNITYNon IdentifyingOPPORTUNITY_LEADOPPORTUNITYZero Or More
OPPORTUNITY_OPPORTUNITY_HISTNon IdentifyingOPPORTUNITYOPPORTUNITY_HISTZero Or More
OPPORTUNITY_OPPORTUNITY_QUOTENon IdentifyingOPPORTUNITYOPPORTUNITY_QUOTEZero Or More
OPPORTUNITY_OPPORTUNITY_QUOTE_OPTIONSNon IdentifyingOPPORTUNITYOPPORTUNITY_QUOTE_OPTIONSZero Or More
OPPORTUNITY_SALESORD_HDRNon IdentifyingOPPORTUNITYSALESORD_HDRZero Or More
OPPORTUNITY_STAGE_OPPORTUNITYNon IdentifyingOPPORTUNITY_STAGEOPPORTUNITYZero Or More
OPPORTUNITY_TASKSNon IdentifyingOPPORTUNITYTASKSZero Or More
OPPORTUNITY_TYPE_OPPORTUNITYNon IdentifyingOPPORTUNITY_TYPEOPPORTUNITYZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (TAXROUNDING)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (TAXTOTAL)
Not NullColumn ConstraintNOT NULL (ESTIMATE)
Not NullColumn ConstraintNOT NULL (CLOSED_VALUE)
Not NullColumn ConstraintNOT NULL (LOST_VALUE)
CAMPAIGN_WAVE_OPPORTUNITYForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
DF_OPPORTUNITY_AMOUNTDefaultColumn ConstraintAMOUNT DEFAULT 0
DF_OPPORTUNITY_CLOSED_VALUEDefaultColumn ConstraintCLOSED_VALUE DEFAULT 0
DF__OPPORTUNI__CAMPA__3F08D327DefaultColumn ConstraintCAMPAIGN_WAVE_SEQNO DEFAULT -1
DF__OPPORTUNI__CURRE__75CEF82CDefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF__OPPORTUNI__ESTIM__63E5521BDefaultColumn ConstraintESTIMATE DEFAULT 0
DF__OPPORTUNI__EXCHR__76C31C65DefaultColumn ConstraintEXCHRATE DEFAULT 1
DF__OPPORTUNI__LOST___64D97654DefaultColumn ConstraintLOST_VALUE DEFAULT 0
DF__OPPORTUNI__TAXRO__3C967AD0DefaultColumn ConstraintTAXROUNDING DEFAULT 0
DF__OPPORTUNI__TAXTO__3BA25697DefaultColumn ConstraintTAXTOTAL DEFAULT 0
OPPORTUNITY_LEAD_OPPORTUNITYForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITY_LEAD) REFERENCES OPPORTUNITY_LEAD(SEQNO)
OPPORTUNITY_STAGE_OPPORTUNITYForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITY_STAGE) REFERENCES OPPORTUNITY_STAGE(SEQNO)
OPPORTUNITY_TYPE_OPPORTUNITYForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITY_TYPE) REFERENCES OPPORTUNITY_TYPE(SEQNO)
PK__OPPORTUNITY__56CA82C8Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_HIST
CommentThis table contains details of History Notes on Opportunities.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the History Note.
OPPORTUNITY_SEQNONoINTEGERYesThe ID number of the Opportunity that the History Note is attached to.
SALESNONoINTEGERNoThe ID number of the staff member who entered the History Note.
TRANSDATENoDATETIMENoThe date and time of the History Notes.
SUBJECTNoVARCHAR(80)NoThe subject line of the History Note.
NOTENoVARCHAR(4096)NoThe body of the History Note.
OUTLOOK_LINKNoVARCHAR(40)NoIf the History Note was emailed, this field contains a link to the email in MS Outlook.

Relationships:
NameRelationship typeParentChildCardinality
OPPORTUNITY_OPPORTUNITY_HISTNon IdentifyingOPPORTUNITYOPPORTUNITY_HISTZero Or More
STAFF_OPPORTUNITY_HISTNon IdentifyingSTAFFOPPORTUNITY_HISTZero Or More

Indexes:
NameIndex columnsIndex type
OPPORTUNITY_HIST_INDEXOPPORTUNITY_SEQNO ASC

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (OPPORTUNITY_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
DF__OPPORTUNI__TRANS__6148113BDefaultColumn ConstraintTRANSDATE DEFAULT getdate()
OPPORTUNITY_OPPORTUNITY_HISTForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITY_SEQNO) REFERENCES OPPORTUNITY(SEQNO)
PK__OPPORTUNITY_HIST__6053ED02Primary KeyTable ConstraintPRIMARY KEY (SEQNO)
STAFF_OPPORTUNITY_HISTForeign KeyTable ConstraintFOREIGN KEY (SALESNO) REFERENCES STAFF(STAFFNO)



Entity: OPPORTUNITY_LEAD
CommentThis table records all Opportunity Lead Sources.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Lead Source.
DESCRIPTIONNoVARCHAR(60)NoThe Lead Source's name/description.

Relationships:
NameRelationship typeParentChildCardinality
OPPORTUNITY_LEAD_OPPORTUNITYNon IdentifyingOPPORTUNITY_LEADOPPORTUNITYZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__OPPORTUNITY_LEAD__5A9B13ACPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_LINES
Comment
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYes
HDR_SEQNONoINTEGERYes
STOCKCODENoVARCHAR(23)Yes
DESCRIPTIONNoVARCHAR(40)Yes
QUANTITYNoFLOAT(53)No
UNITPRICENoFLOAT(53)No
DISCOUNTNoFLOAT(53)No
TAXRATE_NONoINTEGERNo
TAXRATENoFLOAT(53)No
NARRATIVE_SEQNONoINTEGERNo


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (HDR_SEQNO)
Not NullColumn ConstraintNOT NULL (STOCKCODE)
PK__OPPORTUNITY_LINE__45D500F0Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_QUOTE
CommentThis table contains details of the quote lines attached to Opportunities (EXO CRM).
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique identifier for the quote line.
QUOTE_QTYNoFLOAT(53)NoThe quantity on the quote line.
QUOTE_UNITPRNoFLOAT(53)NoThe sell price for the Stock item on the quote line.
ACTUAL_UNITCOSTNoFLOAT(53)NoThe unit cost for the Stock item on the quote line.
TRANSDATENoDATETIMENoThe date and time of the transaction.
EXCHRATENoFLOAT(53)NoThe currency exchange rate used for the quote.
DISCOUNTNoFLOAT(53)NoThe percentage discount on the quote line.
UNITPRICE_INCTAXNoFLOAT(53)NoThe sell price of the Stock item on the quote line, including tax.
HDR_SEQNONoINTEGERYesThe ID number of the Opportunity that this line relates to (OPPORTUNITY.SEQNO).
SECTIONNoINTEGERNo
STOCKCODENoVARCHAR(23)NoThe ID code of the stock item on this line.
DESCRIPTIONNoVARCHAR(60)NoThe description of the stock item on this line.
SHOW_ON_INVOICENoCHAR(1)NoSet to 'Y' if this line should appear on invoices.
COST_CENTRENoINTEGERNoThe Cost Type on the quote line.
LINE_STATUSNoVARCHAR(30)No
COST_CENTRE2NoINTEGERNoThe Cost Group on the quote line.
NARRATIVENoVARCHAR(1)NoSet to 'Y' if there is a narrative on this line.
TAXNONoINTEGERNoThe ID number of the tax rate used on this line.
BRANCHNONoINTEGERNoThe ID number of the branch used on this line.
SUBCODENoINTEGERNoThe GL sub-account on this quote line.
ANALYSISNoINTEGERNo
CURRENCYNONoINTEGERNoThe ID number of the currency that the Sales Order is in.
ALINENONoINTEGERNoA unique line number.
GLCODENoINTEGERNoThe GL account on this quote line.
NARRATIVE_SEQNONoINTEGERNoThe ID number of the narrative on this line.
DIM_LENGTHNoFLOAT(53)YesThe Length value specified for the quote line.
DIM_WIDTHNoFLOAT(53)YesThe Width value specified for the quote line.
DIM_DEPTHNoFLOAT(53)YesThe Depth value specified for the quote line.
TOTAL_QUANTITYNoASNoThe total quantity on the quote line.
PRICE_OVERRIDDENNoCHAR(1)YesSet to 'Y' if the price has been overridden.
BOMTYPENoCHAR(1)NoThe type of Bill of Materials that the line relates to:
N = Normal stock item
B = Build
K = Kit
L = Lookup
BOMPRICINGNoCHAR(1)NoHow the Bill of Materials is priced. Will be one of:
C = pricing by Component
T = Pricing by total
SHOWLINENoCHAR(1)NoSet to 'Y' if the line should be printed on Clarity reports.
LINKEDSTATUSNoCHAR(1)NoThe linked status of the Stock line. Will be one of:
S = Stocked
L = Lookup
N = Not applicable
LISTPRICENoFLOAT(53)NoThe original sell price of the Stock item on this line.
LINETYPENoINTEGERYesThe type of the line. Will be one of:
0 = Not part of a BOM.
1 = Header line of a BOM.
2 = Line of a BOM.
KITSEQNONoINTEGERYesA Bill of Materials SEQNO used to group BOM lines together.
KITCODENoVARCHAR(23)NoThe Bill of Materials code, if the line is part of a BOM.
LINKED_STOCKCODENoVARCHAR(23)NoThe linked Stock code, if applicable.
LINKED_QTYNoFLOAT(53)NoThe linked quantity, if applicable.
HIDDEN_COSTNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level sell costs. For builds that use individual stocklines, this fields stores the lines' real costs.
HIDDEN_SELLNoFLOAT(53)YesThis field applies to Bills of Materials. For kits that use pricing by components, this field stores header-level sell prices. For builds that use individual stocklines, this fields stores the lines' real prices.
SUPPLIERNONoINTEGERNoThe ID number of the supplier for the Stock item on this quote line.
FROMLOCNoINTEGERNoThe ID number of the location that the Stock item on this line is being supplied from.
LINETOTALNoASNoA computed field showing the line total.
NUNITPRNoASNoA computed field showing the line total including GST.
OPTION_NONoINTEGERYesThe option number of the Quote Option on this line (OPPORTUNITY_QUOTE_OPTION.OPTION_NO).
SPREADVALUENoCHAR(1)YesSet to 'Y' if totals can be spread.
TAXRATENoFLOAT(53)YesThe percentage tax rate on the quote line.
LINETOTAL_TAXNoFLOAT(53)YesThe total amount of tax on the quote line.
LINE_TAXNoFLOAT(53)YesThe amount of tax on the quote line.
HIDDEN_LINETOTALNoFLOAT(53)Yes
LINETOTAL_INCTAXNoASNoThe line total including tax.
OPPLINEIDNoINTEGERNoA unique ID number for the line.
LINETAX_OVERRIDENoFLOAT(53)YesIf the tax on the line was manually overridden, this field contains the new value.
LINETAX_OVERRIDDENNoCHAR(1)YesSet to 'Y' if the tax on the line was overridden.
OPTION_NO_SEQNONoINTEGERNoThe ID number of the Quote Option on this line (OPPORTUNITY_QUOTE_OPTION.SEQNO).

Relationships:
NameRelationship typeParentChildCardinality
CURRENCIES_OPPORTUNITY_QUOTENon IdentifyingCURRENCIESOPPORTUNITY_QUOTEZero Or More
GLACCS_OPPORTUNITY_QUOTENon IdentifyingGLACCSOPPORTUNITY_QUOTEZero Or More
NARRATIVES_OPPORTUNITY_QUOTENon IdentifyingNARRATIVESOPPORTUNITY_QUOTEZero Or More
OPPORTUNITY_OPPORTUNITY_QUOTENon IdentifyingOPPORTUNITYOPPORTUNITY_QUOTEZero Or More
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTENon IdentifyingOPPORTUNITY_QUOTE_OPTIONSOPPORTUNITY_QUOTEZero Or More
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTE1Non IdentifyingOPPORTUNITY_QUOTE_OPTIONSOPPORTUNITY_QUOTEZero Or More
STOCK_ITEMS_OPPORTUNITY_QUOTENon IdentifyingSTOCK_ITEMSOPPORTUNITY_QUOTEZero Or More
TAX_RATES_OPPORTUNITY_QUOTENon IdentifyingTAX_RATESOPPORTUNITY_QUOTEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (LINETAX_OVERRIDDEN)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (LINETAX_OVERRIDE)
Not NullColumn ConstraintNOT NULL (HIDDEN_LINETOTAL)
Not NullColumn ConstraintNOT NULL (LINE_TAX)
Not NullColumn ConstraintNOT NULL (LINETOTAL_TAX)
Not NullColumn ConstraintNOT NULL (HDR_SEQNO)
Not NullColumn ConstraintNOT NULL (TAXRATE)
Not NullColumn ConstraintNOT NULL (SPREADVALUE)
Not NullColumn ConstraintNOT NULL (OPTION_NO)
Not NullColumn ConstraintNOT NULL (HIDDEN_SELL)
Not NullColumn ConstraintNOT NULL (HIDDEN_COST)
Not NullColumn ConstraintNOT NULL (KITSEQNO)
Not NullColumn ConstraintNOT NULL (LINETYPE)
Not NullColumn ConstraintNOT NULL (PRICE_OVERRIDDEN)
Not NullColumn ConstraintNOT NULL (DIM_LENGTH)
Not NullColumn ConstraintNOT NULL (DIM_DEPTH)
Not NullColumn ConstraintNOT NULL (DIM_WIDTH)
CURRENCIES_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (CURRENCYNO) REFERENCES CURRENCIES(CURRENCYNO)
DF_OPPORTUNITY_QUOTE_ALINENODefaultColumn ConstraintALINENO DEFAULT 0
DF_OPPORTUNITY_QUOTE_ANALYSISDefaultColumn ConstraintANALYSIS DEFAULT 0
DF_OPPORTUNITY_QUOTE_BOMPRICINGDefaultColumn ConstraintBOMPRICING DEFAULT N
DF_OPPORTUNITY_QUOTE_BOMTYPEDefaultColumn ConstraintBOMTYPE DEFAULT N
DF_OPPORTUNITY_QUOTE_BRANCHNODefaultColumn ConstraintBRANCHNO DEFAULT 0
DF_OPPORTUNITY_QUOTE_CURRENCYNODefaultColumn ConstraintCURRENCYNO DEFAULT 0
DF_OPPORTUNITY_QUOTE_DIM_DEPTHDefaultColumn ConstraintDIM_DEPTH DEFAULT 1
DF_OPPORTUNITY_QUOTE_DIM_LENGTHDefaultColumn ConstraintDIM_LENGTH DEFAULT 1
DF_OPPORTUNITY_QUOTE_DIM_WIDTHDefaultColumn ConstraintDIM_WIDTH DEFAULT 1
DF_OPPORTUNITY_QUOTE_DISCOUNTDefaultColumn ConstraintDISCOUNT DEFAULT 0
DF_OPPORTUNITY_QUOTE_EXCHRATEDefaultColumn ConstraintEXCHRATE DEFAULT 0
DF_OPPORTUNITY_QUOTE_FROMLOCDefaultColumn ConstraintFROMLOC DEFAULT 0
DF_OPPORTUNITY_QUOTE_GLCODEDefaultColumn ConstraintGLCODE DEFAULT 0
DF_OPPORTUNITY_QUOTE_HIDDEN_COSTDefaultColumn ConstraintHIDDEN_COST DEFAULT 0
DF_OPPORTUNITY_QUOTE_HIDDEN_LINETOTALDefaultColumn ConstraintHIDDEN_LINETOTAL DEFAULT 0
DF_OPPORTUNITY_QUOTE_HIDDEN_SELLDefaultColumn ConstraintHIDDEN_SELL DEFAULT 0
DF_OPPORTUNITY_QUOTE_KITSEQNODefaultColumn ConstraintKITSEQNO DEFAULT -1
DF_OPPORTUNITY_QUOTE_LINETOTAL_TAXDefaultColumn ConstraintLINETOTAL_TAX DEFAULT 0
DF_OPPORTUNITY_QUOTE_LINETYPEDefaultColumn ConstraintLINETYPE DEFAULT -1
DF_OPPORTUNITY_QUOTE_LINE_TAXDefaultColumn ConstraintLINE_TAX DEFAULT 0
DF_OPPORTUNITY_QUOTE_LINKEDSTATUSDefaultColumn ConstraintLINKEDSTATUS DEFAULT N
DF_OPPORTUNITY_QUOTE_LINKED_QTYDefaultColumn ConstraintLINKED_QTY DEFAULT 0
DF_OPPORTUNITY_QUOTE_NARRATIVEDefaultColumn ConstraintNARRATIVE DEFAULT N
DF_OPPORTUNITY_QUOTE_OPTION_NODefaultColumn ConstraintOPTION_NO DEFAULT 0
DF_OPPORTUNITY_QUOTE_PRICE_OVERRIDDENDefaultColumn ConstraintPRICE_OVERRIDDEN DEFAULT N
DF_OPPORTUNITY_QUOTE_SHOWLINEDefaultColumn ConstraintSHOWLINE DEFAULT Y
DF_OPPORTUNITY_QUOTE_SPREADVALUEDefaultColumn ConstraintSPREADVALUE DEFAULT Y
DF_OPPORTUNITY_QUOTE_SUBCODEDefaultColumn ConstraintSUBCODE DEFAULT 0
DF_OPPORTUNITY_QUOTE_SUPPLIERNODefaultColumn ConstraintSUPPLIERNO DEFAULT 0
DF_OPPORTUNITY_QUOTE_TAXNODefaultColumn ConstraintTAXNO DEFAULT 0
DF_OPPORTUNITY_QUOTE_TAXRATEDefaultColumn ConstraintTAXRATE DEFAULT 0
DF_OPPORTUNITY_QUOTE_TRANSDATEDefaultColumn ConstraintTRANSDATE DEFAULT getdate()
DF_OPPORTUNITY_QUOTE_UNITPRICE_INCTAXDefaultColumn ConstraintUNITPRICE_INCTAX DEFAULT 0
DF__OPPORTUNI__LINET__39BA0E25DefaultColumn ConstraintLINETAX_OVERRIDE DEFAULT 0
DF__OPPORTUNI__LINET__3AAE325EDefaultColumn ConstraintLINETAX_OVERRIDDEN DEFAULT N
DF__OPPORTUNI__OPTIO__799F8910DefaultColumn ConstraintOPTION_NO_SEQNO DEFAULT -1
GLACCS_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (GLCODE) REFERENCES GLACCS(ACCNO)
NARRATIVES_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (NARRATIVE_SEQNO) REFERENCES NARRATIVES(SEQNO)
OPPORTUNITY_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (HDR_SEQNO) REFERENCES OPPORTUNITY(SEQNO)
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (OPTION_NO_SEQNO) REFERENCES OPPORTUNITY_QUOTE_OPTIONS(SEQNO)
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTE1Foreign KeyTable ConstraintFOREIGN KEY (OPTION_NO) REFERENCES OPPORTUNITY_QUOTE_OPTIONS(OPTION_NO)
PK_OPPORTUNITY_QUOTEPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
STOCK_ITEMS_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (STOCKCODE) REFERENCES STOCK_ITEMS(STOCKCODE)
TAX_RATES_OPPORTUNITY_QUOTEForeign KeyTable ConstraintFOREIGN KEY (TAXNO) REFERENCES TAX_RATES(SEQNO)



Entity: OPPORTUNITY_QUOTE_OPTIONS
CommentThis table records details of the Quote Options available for Opportunity quotes.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Quote Option.
HDR_SEQNONoINTEGERNoThe ID number of the Opportunity that this option applies to.
OPTION_NONoINTEGERNoAn Opportunity-specific ID number for the option.
OPTION_NAMENoVARCHAR(30)NoThe option's name.
OPTION_SELECTEDNoCHAR(1)YesThis field contains 'Y' if the option is currently selected for the Opportunity.

Relationships:
NameRelationship typeParentChildCardinality
OPPORTUNITY_OPPORTUNITY_QUOTE_OPTIONSNon IdentifyingOPPORTUNITYOPPORTUNITY_QUOTE_OPTIONSZero Or More
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTENon IdentifyingOPPORTUNITY_QUOTE_OPTIONSOPPORTUNITY_QUOTEZero Or More
OPPORTUNITY_QUOTE_OPTIONS_OPPORTUNITY_QUOTE1Non IdentifyingOPPORTUNITY_QUOTE_OPTIONSOPPORTUNITY_QUOTEZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (OPTION_SELECTED)
Not NullColumn ConstraintNOT NULL (SEQNO)
DF_OPPORTUNITY_QUOTE_OPTIONS_HDR_SEQNODefaultColumn ConstraintHDR_SEQNO DEFAULT 0
DF_OPPORTUNITY_QUOTE_OPTIONS_OPTION_NODefaultColumn ConstraintOPTION_NO DEFAULT 0
DF_OPPORTUNITY_QUOTE_OPTIONS_OPTION_SELECTEDDefaultColumn ConstraintOPTION_SELECTED DEFAULT N
OPPORTUNITY_OPPORTUNITY_QUOTE_OPTIONSForeign KeyTable ConstraintFOREIGN KEY (HDR_SEQNO) REFERENCES OPPORTUNITY(SEQNO)
PK_OPPORTUNITY_QUOTE_OPTIONSPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_STAGE
CommentThis table records all Opportunity Stages.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Opportunity Stage.
DESCRIPTIONNoVARCHAR(60)NoA description of the stage.
DEF_PROBABILITYNoINTEGERNoThe default probability percentage for the stage.
STATUSKEYNoCHAR(1)NoA unique, one-character short code for the stage.
ADMIN_STATNoCHAR(1)YesIf this field contains 'Y', the stage prevents entry of new transactions.
LOCK_JOBNoCHAR(1)YesIf this field contains 'Y', the stage makes the Opportunity read-only.
ISARCHIVEDNoCHAR(1)YesIf this field contains 'Y', the stage causes the Opportunity to be archived.
ISCOMPLETENoCHAR(1)YesIf this field contains 'Y', the stage causes the Opportunity to be marked as Complete.
ISACTIVENoCHAR(1)YesIf this field contains 'Y', the stage causes the Opportunity to be marked as Active.
ISINVOICEREADYNoCHAR(1)YesIf this field contains 'Y', the stage causes the Opportunity to be marked as Ready for Invoice.
ISLOCKQUOTENoCHAR(1)YesIf this field contains 'Y', the stage causes quotations on the Opportunity to be read-only.
WORKFLOW_CONSTRAINEDNoCHAR(1)YesIf this field contains 'Y', workflow constraints (defined in the OPPORTUNITY_STAGE_CONSTRAINT table) apply to the stage.

Relationships:
NameRelationship typeParentChildCardinality
OPPORTUNITY_STAGE_OPPORTUNITYNon IdentifyingOPPORTUNITY_STAGEOPPORTUNITYZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (WORKFLOW_CONSTRAINED)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (ADMIN_STAT)
Not NullColumn ConstraintNOT NULL (ISLOCKQUOTE)
Not NullColumn ConstraintNOT NULL (LOCK_JOB)
Not NullColumn ConstraintNOT NULL (ISINVOICEREADY)
Not NullColumn ConstraintNOT NULL (ISARCHIVED)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (ISCOMPLETE)
DF__OPPORTUNI__ADMIN__34A0534DDefaultColumn ConstraintADMIN_STAT DEFAULT N
DF__OPPORTUNI__ISACT__3870E431DefaultColumn ConstraintISACTIVE DEFAULT N
DF__OPPORTUNI__ISARC__36889BBFDefaultColumn ConstraintISARCHIVED DEFAULT N
DF__OPPORTUNI__ISCOM__377CBFF8DefaultColumn ConstraintISCOMPLETE DEFAULT N
DF__OPPORTUNI__ISINV__3965086ADefaultColumn ConstraintISINVOICEREADY DEFAULT N
DF__OPPORTUNI__ISLOC__3A592CA3DefaultColumn ConstraintISLOCKQUOTE DEFAULT N
DF__OPPORTUNI__LOCK___35947786DefaultColumn ConstraintLOCK_JOB DEFAULT N
DF__OPPORTUNI__WORKF__3B4D50DCDefaultColumn ConstraintWORKFLOW_CONSTRAINED DEFAULT N
PK__OPPORTUNITY_STAG__5C835C1EPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_STAGE_CONSTRAINT
CommentThis table contains details of Opportunity workflow constraints.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the workflow constraint.
ISACTIVENoCHAR(1)YesIf this field contains 'Y', the constraint applies, so that users are permitted to change an Opportunity from the stage specified by the FROM_STATUS to the stage specified by the TO_STATUS.
FROM_STATUSNoCHAR(1)NoThe source stage for the constraint.
TO_STATUSNoCHAR(1)NoThe destination stage for the constraint.
DESCRIPTIONNoVARCHAR(50)YesA description of the constraint.
SHORTDESCNoVARCHAR(5)YesA short code (5 characters max) for the constraint.
TRACKEVENTNoCHAR(1)NoIf this field contains 'Y', when an Opportunity is changed from the FROM_STATUS to the TO_STATUS, the stage change is recorded in the Event Log.


Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SHORTDESC)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (ISACTIVE)
Not NullColumn ConstraintNOT NULL (DESCRIPTION)
DF_OPPORTUNITY_STAGE_CONSTRAINT_ISACTIVEDefaultColumn ConstraintISACTIVE DEFAULT N
PK_OPPORTUNITY_STAGE_CONSTRAINTPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: OPPORTUNITY_TYPE
CommentThis table records all Opportunity Types.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the Opportunity Type.
DESCRIPTIONNoVARCHAR(60)NoThe name/description of the Opportunity Type.

Relationships:
NameRelationship typeParentChildCardinality
OPPORTUNITY_TYPE_OPPORTUNITYNon IdentifyingOPPORTUNITY_TYPEOPPORTUNITYZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__OPPORTUNITY_TYPE__5E6BA490Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: PERIOD_STATUS
CommentThis table contains details of the age periods set up in the system.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the period.
AGENoINTEGERYesThe age of the period. The current period has an age of 0.
LEDGERNoCHAR(1)YesThe ledger for a specific age.
LOCKEDNoCHAR(1)NoIf set to 'Y', the period is locked, implying that this age in a specific ledger is closed and no more transactions should take place
PERIOD_SEQNONoINTEGERYesThe period's sequence number within fiscal year.
PERIODNAMENoVARCHAR(20)NoThe name/description for the period.
PERIOD_SHORTNAMENoVARCHAR(8)NoA short name for the period.
REPORTCODENoVARCHAR(8)NoA code used for reporting purposes.
YEARAGENoINTEGERYesThe ageing of the year that the period falls in. The current year has an age of 0.
STARTDATENoDATETIMENoThe start date for the period.
STOPDATENoDATETIMENoThe end date for the period.
MINSTOCKSEQNONoINTEGERNoThe first transaction for the period found in the Stock ledger.
MINGLSEQNONoINTEGERNoThe first transaction for the period found in the GLTRANS table.
MINTRANSEQNONoINTEGERNoFor the Debtors ledger, this specifies the first transaction for the period found in the DR_TRANS table.
For the Creditors ledger, this specifies the first transaction for the period found in the CR_TRANS table.
MINTRANLINESEQNONoINTEGERNoFor the Debtors ledger, this specifies the first transaction for the period found in the DR_INVLINES table.
For the Creditors ledger, this specifies the first transaction for the period found in the CR_INVLINES table.
MINORDSEQNONoINTEGERNoFor the Debtors ledger, this specifies the first transaction for the period found in the SALESORD_HDR table.
For the Creditors ledger, this specifies the first transaction for the period found in the PURCHORD_HDR table.
MINORDLINESEQNONoINTEGERNoFor the Debtors ledger, this specifies the first transaction for the period found in the SALESORD_LINES table.
For the Creditors ledger, this specifies the first transaction for the period found in the PURCHORD_LINES table.
FIN_QTRNoINTEGERYesThe financial quarter that the period belongs to.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_PERIOD_STATUSNon IdentifyingPERIOD_STATUSCRM_BUDGETZero Or More
FK_CRM_BUDGET_PERIOD_STATUS1Non IdentifyingPERIOD_STATUSCRM_BUDGETZero Or More
PERIOD_STATUS_CR_ALLOCATIONSNon IdentifyingPERIOD_STATUSCR_ALLOCATIONSZero Or More
PERIOD_STATUS_CR_TRANSNon IdentifyingPERIOD_STATUSCR_TRANSZero Or More
PERIOD_STATUS_DR_ALLOCATIONSNon IdentifyingPERIOD_STATUSDR_ALLOCATIONSZero Or More
PERIOD_STATUS_DR_TRANSNon IdentifyingPERIOD_STATUSDR_TRANSZero Or More
PERIOD_STATUS_INWARDS_GOODS_COSTSNon IdentifyingPERIOD_STATUSINWARDS_GOODS_COSTSZero Or More
PERIOD_STATUS_INWARDS_GOODS_LINESNon IdentifyingPERIOD_STATUSINWARDS_GOODS_LINESZero Or More
PERIOD_STATUS_STOCK_TRANSNon IdentifyingPERIOD_STATUSSTOCK_TRANSZero Or More

Indexes:
NameIndex columnsIndex type
PERIOD_STATUS_AGE_INDEXAGE ASC

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (FIN_QTR)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (AGE)
Not NullColumn ConstraintNOT NULL (YEARAGE)
Not NullColumn ConstraintNOT NULL (LEDGER)
Not NullColumn ConstraintNOT NULL (PERIOD_SEQNO)
DF__PERIOD_STAT__AGE__0ABE5CC3DefaultColumn ConstraintAGE DEFAULT 0
DF__PERIOD_ST__FIN_Q__1F1104E1DefaultColumn ConstraintFIN_QTR DEFAULT 0
DF__PERIOD_ST__LOCKE__0BB280FCDefaultColumn ConstraintLOCKED DEFAULT N
DF__PERIOD_ST__MINGL__5B301089DefaultColumn ConstraintMINGLSEQNO DEFAULT -1
DF__PERIOD_ST__MINOR__5E0C7D34DefaultColumn ConstraintMINORDSEQNO DEFAULT -1
DF__PERIOD_ST__MINOR__5F00A16DDefaultColumn ConstraintMINORDLINESEQNO DEFAULT -1
DF__PERIOD_ST__MINST__5A3BEC50DefaultColumn ConstraintMINSTOCKSEQNO DEFAULT -1
DF__PERIOD_ST__MINTR__5C2434C2DefaultColumn ConstraintMINTRANSEQNO DEFAULT -1
DF__PERIOD_ST__MINTR__5D1858FBDefaultColumn ConstraintMINTRANLINESEQNO DEFAULT -1
DF__PERIOD_ST__PERIO__0CA6A535DefaultColumn ConstraintPERIOD_SEQNO DEFAULT 0
DF__PERIOD_ST__YEARA__0D9AC96EDefaultColumn ConstraintYEARAGE DEFAULT 0
PK__PERIOD_STATUS__09CA388APrimary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: STAFF
CommentThis table stores details of all EXO Business staff members. These are the people who are authorised to log in to and use the EXO Business system.
Primary key columnsSTAFFNO

Attributes:
Column namePrimary keyData typeNot NULLComment
STAFFNOYesINTEGERYesA unique identifier for the staff record.
NAMENoVARCHAR(30)NoThe staff member's full name.
JOBTITLENoVARCHAR(30)NoThe staff member's job title.
EXTENSIONNoVARCHAR(12)NoThe staff member's telephone extension.
PHONENoVARCHAR(30)NoThe staff member's work telephone number.
HOMEPHONENoVARCHAR(30)NoThe staff member's home telephone number.
ISACTIVENoCHAR(1)NoThis field is set to 'Y' if the staff member is currently active, i.e. if their Active flag is ticked in EXO Business Configurator.
APP_PASSWORDNoVARCHAR(30)NoThe staff member's password, used when logging in to the EXO Business system. Passwords are stored in an encrypted format.
MENU_NONoINTEGERNoThe ID number of the Menu Definition specified for the staff member. Corresponds to the menu's SEQNO field in the MENU_COLLECTION table.
AUTH_AMTNoFLOAT(53)NoThe staff member's Credit Invoice Authorisation Limit.
STOCK_AUTH_AMTNoFLOAT(53)NoThe staff member's Stock Purchase Order Authorisation Limit.
NON_STOCK_AUTH_AMTNoFLOAT(53)NoThe staff member's Non-Stock Purchase Order Authorisation Limit.
SECURITYPROFILEIDNoINTEGERYesThe ID number of the staff member's Security profile. Corresponds to the profile's ID field in the PROFILE table.
USERPROFILEIDNoINTEGERYesThe ID number of the staff member's User profile. Corresponds to the profile's ID field in the PROFILE table.
LOGINIDNoVARCHAR(30)YesThe staff member's login ID. This is the ID used to log in to the EXO Business system.
PASSWORD_CHANGEDNoDATETIMEYesThe date and time when the staff member's password was last changed.
LAST_BAD_LOGINNoDATETIMENoThe date and time when the staff member last attempted to log in but failed.
BAD_LOGIN_COUNTNoINTEGERYesThe number of times the staff member has attempted to log in but failed.
LAST_LOGINNoDATETIMENoThe date and time when the staff member last successfully logged in.
ACCOUNT_STATUSNoINTEGERYesThe staff member's account status. Will be one of:
0 = Account OK
1 = Account Locked
2 = Password Expired
EMAIL_ADDRESSNoVARCHAR(50)NoThe staff member's email address.
DISCOUNTRATENoFLOAT(53)YesThe staff member's Discount Rate Limit.
PAYROLL_IDNoVARCHAR(15)NoThe staff member's Employee ID (Payroll) number. This field is used when EXO Business is integrating with an external payroll system, e.g. MYOB EXO Payroll. It must contain the employee's corresponding ID number in the payroll system.
IS_SUPERVISORNoCHAR(1)YesThis field is set to 'Y' if the staff member is designated as a supervisor, i.e. if their Has supervisory override authority flag is ticked.
NICKNAMENoVARCHAR(15)NoA short nickname for the employee.
ABSENTNoCHAR(1)YesThis field is set to 'Y' if the staff member is currently absent, i.e. if their Absent flag is ticked in EXO Business Configurator.
EMPLOYEE_CODENoINTEGERYesThis field is used by the payroll integration functionality.
SMTP_SEQNONoINTEGERNoWhere emails are sent via SMTP using the EXO Business Email Sender, this field contains the ID of the SMTP settings that apply to the staff member (SMTP_ACCOUNT.SEQNO). Set up via the SMTP Server Settings window.
HAS_BUDGETSNoCHAR(1)NoThis field is set to 'Y' if the staff member has been assigned a Sales Team Budget, i.e. if their Has Budget flag is ticked in EXO Business Configurator.
REPORTS_TO_STAFFNONoINTEGERNoThe ID number of the staff member that this staff member reports to.
FACEBOOK_ACCESS_TOKENNoVARCHAR(max)NoIf the staff member uses their own Facebook account when using the EXO Business social media functions, their encrypted access token is stored here.
LINKEDIN_TOKEN_KEYNoVARCHAR(max)NoIf the staff member uses their own LinkedIn account when using the EXO Business social media functions, their encrypted access token key is stored here.
LINKEDIN_TOKEN_SECRETNoVARCHAR(max)NoIf the staff member uses their own LinkedIn account when using the EXO Business social media functions, their encrypted access token secret is stored here.
TWITTER_TOKEN_KEYNoVARCHAR(max)NoIf the staff member uses their own Twitter account when using the EXO Business social media functions, their encrypted access token key is stored here.
TWITTER_TOKEN_SECRETNoVARCHAR(max)NoIf the staff member uses their own Twitter account when using the EXO Business social media functions, their encrypted access token secret is stored here.
API_ACCESSNoCHAR(1)NoThis field contains 'Y' if the staff member is authorised to use the EXO API.
MOBILE_ACCESSNoCHAR(1)YesThis field contains 'Y' if the staff member is authorised to use the EXO OnTheGo mobile app.
BANKFEED_REFRESHTOKENNoVARCHAR(500)NoEncrypted OAuth refresh token used for Bank Feeds.
SBR_REFRESHTOKENNoVARCHAR(1024)NoThe refresh token used for SBR authentication.

Relationships:
NameRelationship typeParentChildCardinality
FK_CRM_BUDGET_EXCLUDED_STAFF_STAFFNon IdentifyingSTAFFCRM_BUDGET_EXCLUDED_STAFFZero Or More
FK_CRM_BUDGET_LINE_STAFFNon IdentifyingSTAFFCRM_BUDGET_LINEZero Or More
MENU_COLLECTION_STAFFNon IdentifyingMENU_COLLECTIONSTAFFZero Or More
STAFF_BILLOMAT_TEMPNon IdentifyingSTAFFBILLOMAT_TEMPZero Or More
STAFF_CAMPAIGNNon IdentifyingSTAFFCAMPAIGNZero Or More
STAFF_CAMPAIGN_HISTNon IdentifyingSTAFFCAMPAIGN_HISTZero Or More
STAFF_CONTACTSNon IdentifyingSTAFFCONTACTSZero Or More
STAFF_CONTACT_LISTNon IdentifyingSTAFFCONTACT_LISTZero Or More
STAFF_CONTACT_LIST1Non IdentifyingSTAFFCONTACT_LISTZero Or More
STAFF_CR_ACCSNon IdentifyingSTAFFCR_ACCSZero Or More
STAFF_CR_CONT_HISTNon IdentifyingSTAFFCR_CONT_HISTZero Or More
STAFF_DR_ACCSNon IdentifyingSTAFFDR_ACCSOne Or More
STAFF_DR_CONT_HISTNon IdentifyingSTAFFDR_CONT_HISTOne Or More
STAFF_DR_TRANSNon IdentifyingSTAFFDR_TRANSZero Or More
STAFF_JOBCOST_HDRNon IdentifyingSTAFFJOBCOST_HDRZero Or More
STAFF_JOBCOST_HDR_MGRNon IdentifyingSTAFFJOBCOST_HDRZero Or More
STAFF_JOBCOST_RESOURCENon IdentifyingSTAFFJOBCOST_RESOURCEZero Or More
STAFF_JOB_TIMESHEETSNon IdentifyingSTAFFJOB_TIMESHEETSZero Or More
STAFF_JOB_TIMESHEET_ALLOWANCENon IdentifyingSTAFFJOB_TIMESHEET_ALLOWANCEZero Or More
STAFF_JOB_TRANSACTIONSNon IdentifyingSTAFFJOB_TRANSACTIONSZero Or More
STAFF_OPPORTUNITY_HISTNon IdentifyingSTAFFOPPORTUNITY_HISTZero Or More
STAFF_STOCK_REQUESTSNon IdentifyingSTAFFSTOCK_REQUESTSZero Or More
STAFF_STOCK_TRANS_HDRNon IdentifyingSTAFFSTOCK_TRANS_HDRZero Or More
STAFF_TASKSNon IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS1Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS2Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS3Non IdentifyingSTAFFTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (MOBILE_ACCESS)
Not NullColumn ConstraintNOT NULL (STAFFNO)
Not NullColumn ConstraintNOT NULL (SECURITYPROFILEID)
Not NullColumn ConstraintNOT NULL (EMPLOYEE_CODE)
Not NullColumn ConstraintNOT NULL (USERPROFILEID)
Not NullColumn ConstraintNOT NULL (ABSENT)
Not NullColumn ConstraintNOT NULL (LOGINID)
Not NullColumn ConstraintNOT NULL (PASSWORD_CHANGED)
Not NullColumn ConstraintNOT NULL (IS_SUPERVISOR)
Not NullColumn ConstraintNOT NULL (BAD_LOGIN_COUNT)
Not NullColumn ConstraintNOT NULL (DISCOUNTRATE)
Not NullColumn ConstraintNOT NULL (ACCOUNT_STATUS)
DF__STAFF__ABSENT__12CA5E36DefaultColumn ConstraintABSENT DEFAULT N
DF__STAFF__ACCOUNT_S__5CACADF9DefaultColumn ConstraintACCOUNT_STATUS DEFAULT 0
DF__STAFF__BAD_LOGIN__5BB889C0DefaultColumn ConstraintBAD_LOGIN_COUNT DEFAULT 0
DF__STAFF__DISCOUNTR__2C146396DefaultColumn ConstraintDISCOUNTRATE DEFAULT 0
DF__STAFF__EMPLOYEE___3DB4BC3BDefaultColumn ConstraintEMPLOYEE_CODE DEFAULT -1
DF__STAFF__HAS_BUDGE__6855017DDefaultColumn ConstraintHAS_BUDGETS DEFAULT N
DF__STAFF__IS_SUPERV__24F33012DefaultColumn ConstraintIS_SUPERVISOR DEFAULT N
DF__STAFF__MOBILE_AC__38F0D275DefaultColumn ConstraintMOBILE_ACCESS DEFAULT N
DF__STAFF__PASSWORD___5AC46587DefaultColumn ConstraintPASSWORD_CHANGED DEFAULT getdate()
DF__STAFF__REPORTS_T__694925B6DefaultColumn ConstraintREPORTS_TO_STAFFNO DEFAULT -1
DF__STAFF__SECURITYP__58DC1D15DefaultColumn ConstraintSECURITYPROFILEID DEFAULT 0
DF__STAFF__SMTP_SEQN__6B667852DefaultColumn ConstraintSMTP_SEQNO DEFAULT -1
DF__STAFF__USERPROFI__59D0414EDefaultColumn ConstraintUSERPROFILEID DEFAULT 0
MENU_COLLECTION_STAFFForeign KeyTable ConstraintFOREIGN KEY (MENU_NO) REFERENCES MENU_COLLECTION(SEQNO)
PK_STAFFPrimary KeyTable ConstraintPRIMARY KEY (STAFFNO)



Entity: TASKS
CommentThis table contains details of all activities (tasks and appointments) in the EXO Business system.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the activity.
PARENTSEQNONoINTEGERNoIdentifies the activity that is the ancestor in a chain of recurrences.
EVENTTYPENoINTEGERNoA number indicating the type of event, where 0 is for a normal activity and all other numbers are used for recurring events.
START_DATETIMENoDATETIMENoThe date and time when the activity starts.
END_DATETIMENoDATETIMENoThe date and time when the activity ends.
OPTIONSNoINTEGERNo2 = All day event
3 = Not an all day event
6 = Not an all day event with reminder
7 = All day event with reminder
SUBJECTNoVARCHAR(60)NoThe subject of the activity.
COMPANYIDNoVARCHAR(50)NoThe ID number of the company the activity relates to. Will be the ACCNO preceded by a letter:
D = Debtor account
C = Creditor account
P = Prospect (Non Account)
CONTACTSEQNONoINTEGERNoThe ID number of the contact the activity is linked to.
OPPORTUNITYSEQNONoINTEGERNoThe ID number of the Opportunity the activity is linked to.
RECURRENCEINDEXNoINTEGERNoSpecifies which one of the activity's recurrences this is.
RECURRENCEINFONoIMAGENoContains information about the recurrences of the activity.
ASSIGNED_TONoINTEGERNoThe ID number of the staff member who the activity has been assigned to.
ASSIGNED_BYNoINTEGERNoThe ID number of the staff member who assigned the activity.
REMINDERDATENoDATETIMENoThe date and time when a reminder for the activity should be displayed.
REMINDERMINUTESNoINTEGERNoWhen the reminder should be displayed, specified as the number of minutes before the start of the activity.
COMPLETEDNoCHAR(1)YesThis field contains "Y" if the activity has been completed.
COMPLETED_DATETIMENoDATETIMENoThe date and time when the activity was completed.
STATENoINTEGERNoThe availability status to be displayed while the activity is active. Will be one of:
0 = Free
1 = Tentative
2 = Busy
3 = Out of office
TYPENoINTEGERNoThe ID number of the activity's type (links to TASK_TYPES).
STATUSNoINTEGERNoThe ID number of the activity's status (links to TASK_STATUSES).
PRIORITYNoVARCHAR(20)NoThe priority given to the activity. Can be "Low", "Normal" or "High".
LABELCOLORNoINTEGERNoThe colour value for the colour used to highlight the activity on calendars.
ACTUALSTARTNoDATETIMENoThe actual datetime stamp when the activity was started. For recurring events it contains the start date of the first occurrence.
ACTUALFINISHNoDATETIMENoThe actual datetime stamp when the activity was finished.
CREATEDBYNoINTEGERNoThe ID number of the staff member who created the activity.
CREATEDATENoDATETIMEYesThe date and time when the activity was created.
MODIFIEDBYNoINTEGERNoThe ID number of the staff member who last modified the activity.
MODIFIEDDATENoDATETIMENoThe date and time when the activity was last edited.
OUTLOOKENTRYIDNoVARCHAR(255)NoIf the activity has been synched to MS Outlook, this field contains the ID number of the corresponding task or appointment in Outlook.
RESOURCEALLOC_SEQNONoINTEGERNoThe number ID of the resource allocation the activity has been created for (links to JOB_RESOURCE_ALLOCATION.SEQNO)
DETAILSNoVARCHAR(5500)NoDetails relating to the activity.
ACTIVITY_TYPENoINTEGERYesThe field contains 0 if the activity is an appointment, or 1 if it is a task.
COMPLETED_PERCENTNoFLOAT(53)YesThe percentage completion amount for the activity (only used for tasks).
DELETED_FLAGNoCHAR(1)YesThis field contains "Y" if the activity has been deleted.
SYNC_ACTIVITYNoCHAR(1)YesThis field contains "Y" if the activity will be synced to MS Outlook.
CAMPAIGN_WAVE_SEQNONoINTEGERNoThe ID number of the campaign wave the activity relates to (links to CAMPAIGN_WAVE.SEQNO).
CAMPAIGN_SEQNONoINTEGERNoThe ID number of the campaign the activity relates to (links to CAMPAIGN.SEQNO).
JOBNONoINTEGERYesThe ID number of the job the activity relates to (links to JOBCOST_HDR.JOBNO).
SU_SEQNONoINTEGERYesThe ID number of the serviceable unit the activity relates to (links to SU_MAIN.SEQNO).
SUBS_HDR_SEQNONoINTEGERYesThe ID number of the subscription the activity relates to (links to SUBS_HDR.SEQNO)
SOURCEIDNoINTEGERNoFor recurring events, this is the ID number of the master/source event.
SO_SEQNONoINTEGERNoThe ID number of the Sales Order the activity relates to (links to SALESORD_HDR.SEQNO).
PO_SEQNONoINTEGERNoThe ID number of the Purchase Order the activity relates to (links to PURCHORD_HDR.SEQNO).

Relationships:
NameRelationship typeParentChildCardinality
CAMPAIGN_TASKSNon IdentifyingCAMPAIGNTASKSZero Or More
CAMPAIGN_WAVE_TASKSNon IdentifyingCAMPAIGN_WAVETASKSZero Or More
CONTACTS_TASKSNon IdentifyingCONTACTSTASKSZero Or More
JOBCOST_HDR_TASKSNon IdentifyingJOBCOST_HDRTASKSZero Or More
JOB_RESOURCE_ALLOCATION_TASKSNon IdentifyingJOB_RESOURCE_ALLOCATIONTASKSZero Or More
OPPORTUNITY_TASKSNon IdentifyingOPPORTUNITYTASKSZero Or More
PURCHORD_HDR_TASKSNon IdentifyingPURCHORD_HDRTASKSZero Or More
SALESORD_HDR_TASKSNon IdentifyingSALESORD_HDRTASKSZero Or More
STAFF_TASKSNon IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS1Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS2Non IdentifyingSTAFFTASKSZero Or More
STAFF_TASKS3Non IdentifyingSTAFFTASKSZero Or More
SUBS_HDR_TASKSNon IdentifyingSUBS_HDRTASKSZero Or More
SU_MAIN_TASKSNon IdentifyingSU_MAINTASKSZero Or More
TASK_STATUSES_TASKSNon IdentifyingTASK_STATUSESTASKSZero Or More
TASK_TYPES_TASKSNon IdentifyingTASK_TYPESTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SUBS_HDR_SEQNO)
Not NullColumn ConstraintNOT NULL (SEQNO)
Not NullColumn ConstraintNOT NULL (COMPLETED)
Not NullColumn ConstraintNOT NULL (SU_SEQNO)
Not NullColumn ConstraintNOT NULL (CREATEDATE)
Not NullColumn ConstraintNOT NULL (JOBNO)
Not NullColumn ConstraintNOT NULL (ACTIVITY_TYPE)
Not NullColumn ConstraintNOT NULL (SYNC_ACTIVITY)
Not NullColumn ConstraintNOT NULL (COMPLETED_PERCENT)
Not NullColumn ConstraintNOT NULL (DELETED_FLAG)
CAMPAIGN_TASKSForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_SEQNO) REFERENCES CAMPAIGN(SEQNO)
CAMPAIGN_WAVE_TASKSForeign KeyTable ConstraintFOREIGN KEY (CAMPAIGN_WAVE_SEQNO) REFERENCES CAMPAIGN_WAVE(SEQNO)
CONTACTS_TASKSForeign KeyTable ConstraintFOREIGN KEY (CONTACTSEQNO) REFERENCES CONTACTS(SEQNO)
DF__TASKS__ACTIVITY___61A803EEDefaultColumn ConstraintACTIVITY_TYPE DEFAULT 0
DF__TASKS__CAMPAIGN___5438FA37DefaultColumn ConstraintCAMPAIGN_WAVE_SEQNO DEFAULT 0
DF__TASKS__CAMPAIGN___6192F555DefaultColumn ConstraintCAMPAIGN_SEQNO DEFAULT 0
DF__TASKS__COMPLETED__629C2827DefaultColumn ConstraintCOMPLETED_PERCENT DEFAULT 0
DF__TASKS__COMPLETED__64247DE6DefaultColumn ConstraintCOMPLETED DEFAULT N
DF__TASKS__CREATEDAT__6518A21FDefaultColumn ConstraintCREATEDATE DEFAULT getdate()
DF__TASKS__DELETED_F__63904C60DefaultColumn ConstraintDELETED_FLAG DEFAULT N
DF__TASKS__JOBNO__04DC3192DefaultColumn ConstraintJOBNO DEFAULT -1
DF__TASKS__PO_SEQNO__12611539DefaultColumn ConstraintPO_SEQNO DEFAULT -1
DF__TASKS__SOURCEID__6756BBA3DefaultColumn ConstraintSOURCEID DEFAULT -1
DF__TASKS__SO_SEQNO__116CF100DefaultColumn ConstraintSO_SEQNO DEFAULT -1
DF__TASKS__SUBS_HDR___06C47A04DefaultColumn ConstraintSUBS_HDR_SEQNO DEFAULT -1
DF__TASKS__SU_SEQNO__05D055CBDefaultColumn ConstraintSU_SEQNO DEFAULT -1
DF__TASKS__SYNC_ACTI__64847099DefaultColumn ConstraintSYNC_ACTIVITY DEFAULT Y
JOBCOST_HDR_TASKSForeign KeyTable ConstraintFOREIGN KEY (JOBNO) REFERENCES JOBCOST_HDR(JOBNO)
JOB_RESOURCE_ALLOCATION_TASKSForeign KeyTable ConstraintFOREIGN KEY (RESOURCEALLOC_SEQNO) REFERENCES JOB_RESOURCE_ALLOCATION(SEQNO)
OPPORTUNITY_TASKSForeign KeyTable ConstraintFOREIGN KEY (OPPORTUNITYSEQNO) REFERENCES OPPORTUNITY(SEQNO)
PK__TASKS__633059ADPrimary KeyTable ConstraintPRIMARY KEY (SEQNO)
PURCHORD_HDR_TASKSForeign KeyTable ConstraintFOREIGN KEY (PO_SEQNO) REFERENCES PURCHORD_HDR(SEQNO)
SALESORD_HDR_TASKSForeign KeyTable ConstraintFOREIGN KEY (SO_SEQNO) REFERENCES SALESORD_HDR(SEQNO)
STAFF_TASKSForeign KeyTable ConstraintFOREIGN KEY (CREATEDBY) REFERENCES STAFF(STAFFNO)
STAFF_TASKS1Foreign KeyTable ConstraintFOREIGN KEY (ASSIGNED_TO) REFERENCES STAFF(STAFFNO)
STAFF_TASKS2Foreign KeyTable ConstraintFOREIGN KEY (ASSIGNED_BY) REFERENCES STAFF(STAFFNO)
STAFF_TASKS3Foreign KeyTable ConstraintFOREIGN KEY (MODIFIEDBY) REFERENCES STAFF(STAFFNO)
SUBS_HDR_TASKSForeign KeyTable ConstraintFOREIGN KEY (SUBS_HDR_SEQNO) REFERENCES SUBS_HDR(SEQNO)
SU_MAIN_TASKSForeign KeyTable ConstraintFOREIGN KEY (SU_SEQNO) REFERENCES SU_MAIN(SEQNO)
TASK_STATUSES_TASKSForeign KeyTable ConstraintFOREIGN KEY (STATUS) REFERENCES TASK_STATUSES(SEQNO)
TASK_TYPES_TASKSForeign KeyTable ConstraintFOREIGN KEY (TYPE) REFERENCES TASK_TYPES(SEQNO)



Entity: TASK_STATUSES
CommentThis table contains details of the statues that can be assigned to activities.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the status.
DESCRIPTIONNoVARCHAR(60)NoThe name/description of the status.

Relationships:
NameRelationship typeParentChildCardinality
TASK_STATUSES_TASKSNon IdentifyingTASK_STATUSESTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__TASK_STATUSES__6700EA91Primary KeyTable ConstraintPRIMARY KEY (SEQNO)



Entity: TASK_TYPES
CommentThis table contains the types that can be assigned to activities.
Primary key columnsSEQNO

Attributes:
Column namePrimary keyData typeNot NULLComment
SEQNOYesINTEGERYesA unique ID number for the type.
DESCRIPTIONNoVARCHAR(60)NoThe type's name/description.

Relationships:
NameRelationship typeParentChildCardinality
TASK_TYPES_TASKSNon IdentifyingTASK_TYPESTASKSZero Or More

Constraints:
NameTypeLevelConstraint
Not NullColumn ConstraintNOT NULL (SEQNO)
PK__TASK_TYPES__68E93303Primary KeyTable ConstraintPRIMARY KEY (SEQNO)