UFN_MKTMARKETINGPLANBRIEF_BASECURRENCIESMATCH
Indicates whether or not the base currency of a marketing plan item matches that of its parent plan.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@BASECURRENCYID | uniqueidentifier | IN | |
@MARKETINGPLANID | uniqueidentifier | IN |
Definition
Copy
create function dbo.[UFN_MKTMARKETINGPLANBRIEF_BASECURRENCIESMATCH]
(
@BASECURRENCYID uniqueidentifier,
@MARKETINGPLANID uniqueidentifier
)
returns bit
as
begin
declare @MATCH bit;
set @MATCH = 1;
if not @BASECURRENCYID is null
set @MATCH = case when @BASECURRENCYID = (select [BASECURRENCYID] from dbo.[MKTMARKETINGPLAN] where [ID] = @MARKETINGPLANID) then 1 else 0 end;
-- if @BASECURRENCYID is null, the trigger on the plan brief table is going to set it to match that of the item, which matches the plan,
-- so the point is moot
return @MATCH;
end;