USP_DATAFORMTEMPLATE_ADD_MKTSEGMENTMEMBERSHIP_PRELOAD
The load procedure used by the edit dataform template "Membership Segment Add Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@QUERYVIEWCATALOGID | uniqueidentifier | INOUT | Record source |
@SMARTQUERIESEXIST | bit | INOUT | Smart queries exist |
@SELECTIONTYPE | tinyint | INOUT | Selection type |
@SEGMENTPARTDEFINITIONID | uniqueidentifier | INOUT | Segment part definition ID |
@SITEID | uniqueidentifier | INOUT | Site |
@SITEREQUIRED | bit | INOUT | Site required? |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_ADD_MKTSEGMENTMEMBERSHIP_PRELOAD]
(
@CURRENTAPPUSERID uniqueidentifier,
@QUERYVIEWCATALOGID uniqueidentifier = null output,
@SMARTQUERIESEXIST bit = null output,
@SELECTIONTYPE tinyint = null output,
@SEGMENTPARTDEFINITIONID uniqueidentifier = null output,
@SITEID uniqueidentifier = null output,
@SITEREQUIRED bit = null output
)
as
set nocount on;
set @SELECTIONTYPE = 3;
-- check for membership-based smart queries
select @SMARTQUERIESEXIST = dbo.[UFN_MKTSELECTION_SMARTQUERIESEXIST](@SELECTIONTYPE);
declare @T1 table([VALUE] uniqueidentifier, [LABEL] nvarchar(255));
-- if there is only one valid record source, then default it
insert into @T1
exec dbo.[USP_SIMPLEDATALIST_MKTRECORDSSOURCE] @CURRENTAPPUSERID;
if @@ROWCOUNT = 1
select @QUERYVIEWCATALOGID = [VALUE]
from @T1;
/* Get the source code part definition ID for segment */
select @SEGMENTPARTDEFINITIONID = [ID] from dbo.[MKTSOURCECODEPARTDEFINITION] where [ITEMTYPECODE] = 1;
set @SITEID = dbo.[UFN_APPUSER_DEFAULTSITEFORUSER](@CURRENTAPPUSERID);
set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, 'EF00F8AF-1589-464A-BEEE-19BC78691ED9', 1);
return 0;