USP_SIMPLEDATALIST_MKTASKLADDER
Returns a simple list of all ask ladders.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ISACTIVE | bit | IN | |
@RECORDSOURCEID | uniqueidentifier | IN | |
@BASECURRENCYID | uniqueidentifier | IN | |
@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_MKTASKLADDER]
(
@ISACTIVE bit = 1,
@RECORDSOURCEID uniqueidentifier = null,
@BASECURRENCYID uniqueidentifier = null,
@CURRENTAPPUSERID uniqueidentifier = null,
@SECURITYFEATUREID uniqueidentifier = null,
@SECURITYFEATURETYPE tinyint = null
)
as
set nocount on;
--If @ISACTIVE is 0 display all ask ladders
if @ISACTIVE = 0
set @ISACTIVE = null;
if @RECORDSOURCEID = '00000000-0000-0000-0000-000000000000'
set @RECORDSOURCEID = null;
select distinct
[MKTASKLADDER].[ID] as [VALUE],
dbo.[UFN_MKTASKLADDER_GETNAME]([ID]) as [LABEL]
from dbo.[MKTASKLADDER]
where (@ISACTIVE is null or @ISACTIVE = [ISACTIVE])
and (@RECORDSOURCEID is null or (@RECORDSOURCEID = [RECORDSOURCEID] or len([OBJECTKEY]) = 0))
and (@BASECURRENCYID is null or @BASECURRENCYID = [MKTASKLADDER].[BASECURRENCYID])
and (dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 or exists (select 1 from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID,@SECURITYFEATUREID,@SECURITYFEATURETYPE) where SITEID=[MKTASKLADDER].[SITEID] or (SITEID is null and [MKTASKLADDER].[SITEID] is null)))
order by [LABEL];
return 0;