UFN_COMMUNICATIONLETTER_GETDEFAULTEXPORTDEFINITIONID

This function returns the default export definition for the given channel and communication letter type.

Return

Return Type
uniqueidentifier

Parameters

Parameter Parameter Type Mode Description
@COMMUNICATIONTYPECODE tinyint IN
@CHANNELCODE tinyint IN

Definition

Copy


CREATE function dbo.UFN_COMMUNICATIONLETTER_GETDEFAULTEXPORTDEFINITIONID
(
    @COMMUNICATIONTYPECODE tinyint,
    @CHANNELCODE tinyint
)
returns uniqueidentifier
with execute as caller
as begin
    declare @EXPORTDEFINITIONID uniqueidentifier = null;

    -- @COMMINICATIONTYPECODE - enum from MKTSegmentation table and CommunicationLetter table

    --        0 - Direct marketing effort

    --        1 - Appeal mailing

    --        2 - Event invitation

    --        3 - Acknowledgement

    --        4 - Reminder


    -- @CHANNELCODE pertains to the first two CHANNELCODE values on the CommunicationLetter table

    --    0 - Mail

    --    1 - Email


    set @EXPORTDEFINITIONID = 
        case @COMMUNICATIONTYPECODE
            when 1 then '5BB7835A-2634-4B01-A4BC-832C87B99EA9'
            when 3 then '645FDAC2-FCCD-4D55-97CB-10A6265E943C'
            when 4 then 'D491CEA0-5990-43E9-9C54-9520F19D9214'

        end

    return @EXPORTDEFINITIONID;
end