USP_SIMPLEDATALIST_CONSTITUENTSITES

List of all sites in the system that a given user could interact with (based on Role assignments) and any sites assigned to the constituent that the user does not otherwise have access.

Parameters

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

Definition

Copy


                CREATE procedure dbo.USP_SIMPLEDATALIST_CONSTITUENTSITES
                (
                    @CURRENTAPPUSERID uniqueidentifier,
                    @CONSTITUENTID uniqueidentifier
                )
                as
                    set nocount on;

                    select                     
                        SFU.[SITEID] as VALUE
                        SITE.[NAME] as LABEL                         
                    from                     
                        dbo.SITE 
                        inner join dbo.UFN_SITESFORUSER(@CURRENTAPPUSERID) AS SFU ON SFU.SITEID = SITE.ID
                    union
                    select
                        CONSTITUENTSITE.SITEID as VALUE,
                        SITE.NAME as LABEL
                    from
                        dbo.CONSTITUENTSITE
                        inner join dbo.SITE on SITE.ID = CONSTITUENTSITE.SITEID
                    where
                        CONSTITUENTSITE.CONSTITUENTID = @CONSTITUENTID
                    order by
                        LABEL