UFN_CONSTITUENT_MAPFROM_RECURRINGGIFTWRITEOFF

Maps a recurring gift writeoff to the constituent who owns it.

Return

Return Type
uniqueidentifier

Parameters

Parameter Parameter Type Mode Description
@RECURRINGGIFTWRITEOFFID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_CONSTITUENT_MAPFROM_RECURRINGGIFTWRITEOFF(
    @RECURRINGGIFTWRITEOFFID uniqueidentifier
)
returns uniqueidentifier
with execute as caller
as begin
    declare @CONSTITUENTID uniqueidentifier;

    select top 1 
        @CONSTITUENTID = REVENUE.CONSTITUENTID
    from dbo.REVENUE
    inner join dbo.RECURRINGGIFTWRITEOFF on RECURRINGGIFTWRITEOFF.REVENUEID = REVENUE.ID
    where RECURRINGGIFTWRITEOFF.ID = @RECURRINGGIFTWRITEOFFID;

    return @CONSTITUENTID;
end