USP_DATALIST_PROSPECTSFLAGGED

List of prospects flagged for attention by the current user.

Parameters

Parameter Parameter Type Mode Description
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_PROSPECTSFLAGGED
                    @CURRENTAPPUSERID uniqueidentifier
                as begin
                    set nocount on;

                    select 
                        C.ID,
                        C.NAME,
                        W.WEALTHPOINTDATE
                    from
                        dbo.FLAGGEDPROSPECT FP
                        inner join dbo.CONSTITUENT C on C.ID=FP.PROSPECTID
                        left outer join dbo.WEALTH W on W.ID=C.ID
                    where
                        FP.APPUSERID=@CURRENTAPPUSERID and
                        dbo.UFN_CONSTITUENT_ISPROSPECT(C.ID) = 1
                    order by
                        C.KEYNAME, C.NAME;
                end