USP_DATAFORMTEMPLATE_ADD_MKTSEGMENT_PRELOAD
The load procedure used by the edit dataform template "Constituent 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 |
@SITEID | uniqueidentifier | INOUT | Site |
@SITEREQUIRED | bit | INOUT | Site required? |
@SEGMENTPARTDEFINITIONID | uniqueidentifier | INOUT |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_ADD_MKTSEGMENT_PRELOAD]
(
@CURRENTAPPUSERID uniqueidentifier,
@QUERYVIEWCATALOGID uniqueidentifier = null output,
@SMARTQUERIESEXIST bit = null output,
@SITEID uniqueidentifier = null output,
@SITEREQUIRED bit = null output,
@SEGMENTPARTDEFINITIONID uniqueidentifier = null output
)
as
set nocount on;
select @SMARTQUERIESEXIST = dbo.[UFN_MKTSELECTION_SMARTQUERIESEXIST](1);
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;
set @SITEID = dbo.[UFN_APPUSER_DEFAULTSITEFORUSER](@CURRENTAPPUSERID);
set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '3A35CAA4-6A93-4EAD-B615-255777496F0C', 1);
select @SEGMENTPARTDEFINITIONID = [ID] from dbo.[MKTSOURCECODEPARTDEFINITION] where [ITEMTYPECODE] = 1;
return 0;