USP_DATAFORMTEMPLATE_ADD_MKTSEGMENTMARKETINGLOCATION_PRELOAD
The load procedure used by the edit dataform template "Marketing Location 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 |
@LOCATIONCOUNTRYID | uniqueidentifier | INOUT | Country |
@GROUPS | xml | INOUT | Assign this segment to the groups marked below |
@SEGMENTPARTDEFINITIONID | uniqueidentifier | INOUT | Segment part definition ID |
@SITEID | uniqueidentifier | INOUT | Site |
@SITEREQUIRED | bit | INOUT | Site required? |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_ADD_MKTSEGMENTMARKETINGLOCATION_PRELOAD]
(
@CURRENTAPPUSERID uniqueidentifier,
@QUERYVIEWCATALOGID uniqueidentifier = null output,
@LOCATIONCOUNTRYID uniqueidentifier = null output,
@GROUPS xml = null output,
@SEGMENTPARTDEFINITIONID uniqueidentifier = null output,
@SITEID uniqueidentifier = null output,
@SITEREQUIRED bit = null output
)
as
set nocount on;
declare @TEMP table([VALUE] uniqueidentifier, [LABEL] nvarchar(255));
-- if there is only one valid record source, then default it
insert into @TEMP
exec dbo.[USP_SIMPLEDATALIST_MKTRECORDSSOURCE] @CURRENTAPPUSERID;
if @@ROWCOUNT = 1
select @QUERYVIEWCATALOGID = [VALUE] from @TEMP;
exec @LOCATIONCOUNTRYID = dbo.[UFN_COUNTRY_GETDEFAULT];
/* 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, '848157BC-2174-460E-97E4-32FCDC3D5C9A', 1);
return 0;