USP_SIMPLEDATALIST_STRATEGIES

List or plan outlines defined in the system.

Parameters

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

Definition

Copy


CREATE procedure dbo.USP_SIMPLEDATALIST_STRATEGIES
(
    @CURRENTAPPUSERID uniqueidentifier = null,
    @SECURITYFEATUREID uniqueidentifier = null,
    @SECURITYFEATURETYPE tinyint = null
)
as begin
    set nocount on;
    select 
        PLANOUTLINE.ID as VALUE,
        case 
          when SITE.NAME is null then PLANOUTLINE.NAME
          else PLANOUTLINE.NAME + ' (' + SITE.NAME    + ')'
        end as LABEL
    from
        dbo.PLANOUTLINE
        left join dbo.SITE on SITE.ID = PLANOUTLINE.SITEID
    where
        (dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 or exists (select 1 from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID,@SECURITYFEATUREID,@SECURITYFEATURETYPE) where SITEID=[PLANOUTLINE].[SITEID] or (SITEID is null and [PLANOUTLINE].[SITEID] is null)))
    order by
        PLANOUTLINE.NAME
end