USP_SIMPLEDATALIST_MKTLIST
Returns a simple list of all active acquisition lists.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@RECORDSOURCEID | uniqueidentifier | IN | Record source |
@LISTID | uniqueidentifier | IN | List |
@SECURITYFEATUREID | uniqueidentifier | IN | |
@SECURITYFEATURETYPE | tinyint | IN | |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@BASECURRENCYID | uniqueidentifier | IN |
Definition
Copy
CREATE procedure dbo.[USP_SIMPLEDATALIST_MKTLIST]
(
@RECORDSOURCEID uniqueidentifier = null,
@LISTID uniqueidentifier = null,
@SECURITYFEATUREID uniqueidentifier = null,
@SECURITYFEATURETYPE tinyint = null,
@CURRENTAPPUSERID uniqueidentifier = null,
@BASECURRENCYID uniqueidentifier = null
)
as
set nocount on;
select distinct
[ID] as [VALUE],
[NAME] as [LABEL]
from dbo.[MKTLIST]
where
(@RECORDSOURCEID is null or [RECORDSOURCEID] = @RECORDSOURCEID)
and ([ISINACTIVE] = 0 or [ID] = @LISTID)
and (@BASECURRENCYID is null or [BASECURRENCYID] = @BASECURRENCYID)
and (dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 or exists (select 1 from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID,@SECURITYFEATUREID,@SECURITYFEATURETYPE) where SITEID=[MKTLIST].[SITEID] or (SITEID is null and [MKTLIST].[SITEID] is null)))
order by [NAME];
return 0;