UFN_CONSTITUENT_ISORGANIZATION

Validates whether the constituent record is an organization.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@CONSTITUENTID uniqueidentifier IN

Definition

Copy


            CREATE function dbo.UFN_CONSTITUENT_ISORGANIZATION(@CONSTITUENTID uniqueidentifier) returns bit
            with execute as caller
            AS
            begin

                declare @ISORG tinyint

                if @CONSTITUENTID is not null
                    begin
                        -- individuals cannot have rows in this table

                        select @ISORG = ISORGANIZATION from dbo.CONSTITUENT where ID = @CONSTITUENTID
                        if @ISORG = 1 return 1
                    end
                return 0
            end