UFN_MKTMEMBERSHIPMAILINGTEMPLATERULE_BASECURRENCIESMATCH

Indicates whether or not the base currency of a membership renewal effort rule matches that of its parent membership template.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@BASECURRENCYID uniqueidentifier IN
@MEMBERSHIPMAILINGTEMPLATEID uniqueidentifier IN

Definition

Copy


create function dbo.[UFN_MKTMEMBERSHIPMAILINGTEMPLATERULE_BASECURRENCIESMATCH]
(
  @BASECURRENCYID uniqueidentifier,
  @MEMBERSHIPMAILINGTEMPLATEID uniqueidentifier
)
returns bit
as
begin
  declare @MATCH bit;

  if @BASECURRENCYID is not null
    set @MATCH = (case when @BASECURRENCYID = (select [BASECURRENCYID] from dbo.[MKTMEMBERSHIPMAILINGTEMPLATE] where [ID] = @MEMBERSHIPMAILINGTEMPLATEID) then 1 else 0 end);
  else
    -- if @BASECURRENCYID is null, the trigger on the membership template rule table is going to set it to match that of the template, so the point is moot

    set @MATCH = 1;

  return @MATCH;
end;