if object_id('CSEasyO365Queue') is null
begin
	CREATE TABLE [dbo].[CSEasyO365Queue](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[RequestID] [uniqueidentifier] NOT NULL,
		[RequestHID] [int] NOT NULL,
		[ExchangeID] [nvarchar](512) NULL,
		[Action] [int] NOT NULL,
		[InProcess] [tinyint] NOT NULL,
		[RetryCount] [int] NOT NULL,
		[LastError] [nvarchar](max) NULL,
		[SysCreated] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365Queue] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365Queue] ADD  CONSTRAINT [DF_CSEasyO365Queue_InProcess]  DEFAULT (0) FOR [InProcess];
	ALTER TABLE [dbo].[CSEasyO365Queue] ADD  CONSTRAINT [DF_CSEasyO365Queue_RetryCount]  DEFAULT (0) FOR [RetryCount];
	ALTER TABLE [dbo].[CSEasyO365Queue] ADD  CONSTRAINT [DF_CSEasyO365Queue_SysCreated]  DEFAULT (getdate()) FOR [SysCreated];

	CREATE NONCLUSTERED INDEX [IX_CSEasyO365Queue_RequestHID] ON [dbo].[CSEasyO365Queue] ([RequestHID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
end
GO

if object_id('CSEasyO365Log') is null
begin
	CREATE TABLE [dbo].[CSEasyO365Log](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[RequestID] [uniqueidentifier] NULL,
		[RequestHID] [int] NULL,
		[Email] [nvarchar](128) NOT NULL,
		[Direction] [nchar](1) NOT NULL,
		[Url] [nvarchar](max) NULL,
		[Json] [nvarchar](max) NULL,
		[JsonResponse] [nvarchar](max) NULL,
		[Action] [int] NULL,
		[ExchangeID] [nvarchar](512) NULL,
		[Success] [tinyint] NULL,
		[Error] [nvarchar](max) NULL,
		[SysCreated] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365Log] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365Log] ADD  CONSTRAINT [DF_CSEasyO365Log_SysCreated]  DEFAULT (getdate()) FOR [SysCreated];
end
GO

delete from DDTests where Tablename = 'CSEasyO365Log' and FieldName = 'Direction'
go

insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('I', 'CSEasyO365Log', 'Direction', 'I', 'Incoming', 24764, '', 0)
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('O', 'CSEasyO365Log', 'Direction', 'O', 'Outgoing', 24765, '', 1)
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('Q', 'CSEasyO365Log', 'Direction', 'Q', 'Queue', 0, '', 2)
go



if object_id('CSEasyO365Connections') is null
begin
	CREATE TABLE [dbo].[CSEasyO365Connections](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[Name] [nvarchar](128) NOT NULL,
		[ConnectionInfo] [nvarchar](max) NOT NULL,
		[AuthToken] [nvarchar](max) NOT NULL,
		[SysCreated] [datetime] NOT NULL,
		[SysModified] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365Connections] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365Connections] ADD  CONSTRAINT [DF_CSEasyO365Connections_SysCreated]  DEFAULT (getdate()) FOR [SysCreated];
	ALTER TABLE [dbo].[CSEasyO365Connections] ADD  CONSTRAINT [DF_CSEasyO365Connections_SysModified]  DEFAULT (getdate()) FOR [SysModified];
end
GO


if object_id('CSEasyO365RequestTypes') is null
begin
	CREATE TABLE [dbo].[CSEasyO365RequestTypes](
		[LinkID] [int] NOT NULL,
		[UseType] [tinyint] NULL,
		[ShowAs] [nchar](1) NULL,
		[UsePriority] [tinyint] NULL,
		[InviteContactperson] [tinyint] NULL,
		[UseColor] [tinyint] NULL,
		[Color] [int] NULL,
		[LocationField] [int] NULL,
		[UseReminder] [tinyint] NULL,
	 CONSTRAINT [PK_CSEasyO365RequestTypes] PRIMARY KEY CLUSTERED 
	(
		[LinkID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365RequestTypes]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365RequestTypes_AbsenceTypes] FOREIGN KEY([LinkID])
		REFERENCES [dbo].[AbsenceTypes] ([ID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;
end
GO

delete from DDTests where Tablename = 'CSEasyO365RequestTypes';

insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermId, Options, SeqNr) values('B', 'CSEasyO365RequestTypes', 'ShowAs', 'B', 'Busy', 0, '', 0);
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermId, Options, SeqNr) values('W', 'CSEasyO365RequestTypes', 'ShowAs', 'W', 'Working elsewhere', 0, '', 1);
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermId, Options, SeqNr) values('O', 'CSEasyO365RequestTypes', 'ShowAs', 'O', 'Out of office', 216, '', 2);
go


if object_id('CSEasyO365Request') is null
begin
	CREATE TABLE [dbo].[CSEasyO365Request](
		[LinkID] [uniqueidentifier] NOT NULL,
		[ExchangeID] [nvarchar](512) NULL,
		[MasterExchangeID] [nvarchar](512) NULL,
		[HTMLContent] [nvarchar](max) NULL,
		[OnlineMeetingUrl] [nvarchar](max) NULL,
		[Editable] [tinyint] null
	 CONSTRAINT [PK_CSEasyO365Request] PRIMARY KEY CLUSTERED 
	(
		[LinkID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365Request]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365Request_Absences] FOREIGN KEY([LinkID])
		REFERENCES [dbo].[Absences] ([ID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;

	CREATE NONCLUSTERED INDEX [IX_CSEasyO365Request_ExchangeID] ON [dbo].[CSEasyO365Request] ([ExchangeID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
end
GO


if object_id('CSEasyO365RequestAttendees') is null
begin
	CREATE TABLE [dbo].[CSEasyO365RequestAttendees](
		[RecordID] [int] NOT NULL IDENTITY(1, 1),
		[LinkID] [uniqueidentifier] NOT NULL,
		[cmp_wwn] [uniqueidentifier] NULL,
		[cnt_id] [uniqueidentifier] NULL,
		[res_id] [int] NULL,
		[Name] [nvarchar](512) NULL,
		[Email] [nvarchar](512) NULL,
		[Type] [nvarchar](20) NULL,
		[Status] [nvarchar](50) NULL,
		[StatusTime] [datetime] NULL,
	 CONSTRAINT [PK_CSEasyO365RequestAttendees] PRIMARY KEY CLUSTERED 
	(
		[RecordID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365RequestAttendees]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365RequestAttendees_Absences] FOREIGN KEY([LinkID])
		REFERENCES [dbo].[Absences] ([ID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;


	CREATE NONCLUSTERED INDEX [IX_CSEasyO365RequestAttendees_LinkID] ON [dbo].[CSEasyO365RequestAttendees] ([LinkID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
end
GO







if object_id('CSEasyO365Humres') is null
begin
	CREATE TABLE [dbo].[CSEasyO365Humres](
		[LinkID] [int] NOT NULL,
		[Calendars] [nvarchar](max) NULL,
		[MailBoxes] [nvarchar](max) NULL,
		[MailBoxesOut] [nvarchar](max) NULL,
	 CONSTRAINT [PK_CSEasyO365Humres] PRIMARY KEY CLUSTERED 
	(
		[LinkID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365Humres]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365Humres_Humres] FOREIGN KEY([LinkID])
		REFERENCES [dbo].[Humres] ([res_id])
		ON UPDATE CASCADE
		ON DELETE CASCADE;
end
GO


if object_id('CSEasyO365_Appointment_CreateTeams') is not null
	drop function dbo.CSEasyO365_Appointment_CreateTeams
go

create function dbo.CSEasyO365_Appointment_CreateTeams(@ID uniqueidentifier, @Type int)
returns tinyint
as
begin
	declare @retval tinyint
	set @retval = 0

	-- TODO
	-- implement customer specific
	return @retval
end
go

if object_id('CSEasyO365_Appointment_Location') is not null
	drop function dbo.CSEasyO365_Appointment_Location
go

create function dbo.CSEasyO365_Appointment_Location(@ID uniqueidentifier, @Type int)
returns nvarchar(255)
as
begin
	declare @retval nvarchar(255)

	-- TODO
	-- implement customer specific
	return @retval
end
go


if object_id('CSEasyO365_Appointment_IsTeamsProperty') is not null
	drop function dbo.CSEasyO365_Appointment_IsTeamsProperty
go

create function dbo.CSEasyO365_Appointment_IsTeamsProperty(@ID uniqueidentifier, @Type int)
returns @property table(PropertyName nvarchar(128), PropertyValueTrue nvarchar(60), PropertyValueFalse nvarchar(60))
as
begin
	-- TODO
	-- implement customer specific
	return
end
go




insert into CSEasyO365Request(LinkID, Editable)
    select a.ID, 1
    from Absences a
    where not exists(select * from CSEasyO365Request r where r.LinkID = a.ID)
go


if object_id('CSEasyO365DebugLog') is null
begin
	CREATE TABLE [dbo].[CSEasyO365DebugLog](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[Email] [nvarchar](128) NOT NULL,
		[Direction] [nchar](1) NOT NULL,
		[ExchangeID] [nvarchar](512) NULL,
		[MasterExchangeID] [nvarchar](512) NULL,
		[Json] [nvarchar](max) NULL,
		[StartDate] [datetime] NULL,
		[EndDate] [datetime] NULL,
		[Subject] [nvarchar](255) NULL,
		[FoundRequestID] [uniqueidentifier] NULL,
		[FoundRequestIDMode] [int] NULL,
		[SynchStartDate] [datetime] NULL,
		[SysCreated] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365DebugLog] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];
end
GO


if object_id('CSEasyO365EmailSettings') is null
begin
	CREATE TABLE [dbo].[CSEasyO365EmailSettings](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[Active] [tinyint] NOT NULL,
		[Description] [nvarchar](255) NOT NULL,
		[Folder] [nvarchar](128) NOT NULL,
		[MarkAsRead] [tinyint] NOT NULL,
		[DocumentType] [int] NULL,
		[AllowDuplicateDocuments] [tinyint] NOT NULL,
		[KeepRepliesTogether] [tinyint] NOT NULL,
		[RequestType] [int] NULL,
		[AllowDuplicateRequests] [tinyint] NOT NULL,
		[UpdateDocumentInRequest] [tinyint] NOT NULL,
		[CreateRequestMoment] [nchar](1) NOT NULL,
		[TrackSentItems] [tinyint] NOT NULL,
		[SysCreator] [int] NOT NULL,
		[SysCreated] [datetime] NOT NULL,
		[SysModifier] [int] NOT NULL,
		[SysModified] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365EmailSettings] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365EmailSettings]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365EmailSettings_BacoDiscussionFixedTypes] FOREIGN KEY([DocumentType])
		REFERENCES [dbo].[BacoDiscussionFixedTypes] ([TypeID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;

	ALTER TABLE [dbo].[CSEasyO365EmailSettings]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365EmailSettings_AbsenceTypes] FOREIGN KEY([RequestType])
		REFERENCES [dbo].[AbsenceTypes] ([ID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;

	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_Active]  DEFAULT (1) FOR [Active];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_KeepRepliesTogether]  DEFAULT (0) FOR [KeepRepliesTogether];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_TrackSentItems]  DEFAULT (0) FOR [TrackSentItems];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_AllowDuplicateRequests]  DEFAULT (1) FOR [AllowDuplicateRequests];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_AllowDuplicateDocuments]  DEFAULT (1) FOR [AllowDuplicateDocuments];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_UpdateDocumentInRequest]  DEFAULT (0) FOR [UpdateDocumentInRequest];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_MarkAsRead]  DEFAULT (0) FOR [MarkAsRead];
	
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_SysCreated]  DEFAULT (getdate()) FOR [SysCreated];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_SysModified]  DEFAULT (getdate()) FOR [SysModified];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_SysCreator]  DEFAULT (0) FOR [SysCreator];
	ALTER TABLE [dbo].[CSEasyO365EmailSettings] ADD  CONSTRAINT [DF_CSEasyO365EmailSettings_SysModifier]  DEFAULT (0) FOR [SysModifier];

	CREATE UNIQUE NONCLUSTERED INDEX [IX_CSEasyO365EmailSettings_Description] ON [dbo].[CSEasyO365EmailSettings] ([Description] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
	CREATE UNIQUE NONCLUSTERED INDEX [IX_CSEasyO365EmailSettings_Folder] ON [dbo].[CSEasyO365EmailSettings] ([Folder] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
end
GO


if object_id('CSEasyO365DebugLogEmail') is null
begin
	CREATE TABLE [dbo].[CSEasyO365DebugLogEmail](
		[ID] [int] IDENTITY(1, 1) NOT NULL,
		[Email] [nvarchar](128) NOT NULL,
		[IsInbox] [tinyint] NOT NULL default(1),
		[ExchangeID] [nvarchar](512) NULL,
		[ConversationId] [nvarchar](512) NULL,
		[ConversationIndex] [nvarchar](512) NULL,
		[internetMessageId] [nvarchar](1024) NULL,
		[ReferencesId] [nvarchar](max) NULL,
		[InReplyToId] [nvarchar](1024) NULL,
		[Json] [nvarchar](max) NULL,
		[Subject] [nvarchar](255) NULL,
		[FoundRequestID] [uniqueidentifier] NULL,
		[FoundDocumentID] [uniqueidentifier] NULL,
		[LogMessage] [nvarchar](max) NULL,
		[SysCreated] [datetime] NOT NULL,
	 CONSTRAINT [PK_CSEasyO365DebugLogEmail] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];
end
GO



if object_id('CSEasyO365BacoDiscussions') is null
begin
	CREATE TABLE [dbo].[CSEasyO365BacoDiscussions](
		[LinkID] [uniqueidentifier] NOT NULL,
		[internetMessageId] [nvarchar](1024) NULL,
	 CONSTRAINT [PK_CSEasyO365BacoDiscussions] PRIMARY KEY CLUSTERED 
	(
		[LinkID] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY];

	ALTER TABLE [dbo].[CSEasyO365BacoDiscussions]  WITH CHECK ADD  CONSTRAINT [FK_CSEasyO365BacoDiscussions_BacoDiscussions] FOREIGN KEY([LinkID])
		REFERENCES [dbo].[BacoDiscussions] ([ID])
		ON UPDATE CASCADE
		ON DELETE CASCADE;
end
GO



if not exists(select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'CSEasyO365Humres' and COLUMN_NAME = 'MailBoxesOut')
begin
	ALTER TABLE [dbo].[CSEasyO365Humres]
		ADD [MailBoxesOut] [nvarchar](max) NULL
end
go


if not exists(select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'CSEasyO365DebugLogEmail' and COLUMN_NAME = 'IsInbox')
begin
	ALTER TABLE [dbo].[CSEasyO365DebugLogEmail]
		ADD [IsInbox] [tinyint] NOT NULL default(1)
end
go


if not exists(select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'CSEasyO365EmailSettings' and COLUMN_NAME = 'CreateRequestMoment')
begin
	ALTER TABLE [dbo].[CSEasyO365EmailSettings]
		ADD [CreateRequestMoment] [nchar](1) NOT NULL default('I')
end
go

delete from DDTests where Tablename = 'CSEasyO365EmailSettings' and FieldName = 'CreateRequestMoment'
go

insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('I', 'CSEasyO365EmailSettings', 'CreateRequestMoment', 'I', 'Incoming', 24764, '', 0)
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('O', 'CSEasyO365EmailSettings', 'CreateRequestMoment', 'O', 'Outgoing', 24765, '', 1)
insert into DDTests(DatabaseChar, Tablename, FieldName, DisplayChar, Description, TermID, Options, SeqNr) values('B', 'CSEasyO365EmailSettings', 'CreateRequestMoment', 'B', 'Incoming and Outgoing', 0, '', 2)
go
