USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTMARKETINGLOCATION
The load procedure used by the edit dataform template "Marketing Location Edit Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@QUERYVIEWCATALOGID | uniqueidentifier | INOUT | Record source |
@NAME | nvarchar(100) | INOUT | Name |
@DESCRIPTION | nvarchar(255) | INOUT | Description |
@SEGMENTCATEGORYCODEID | uniqueidentifier | INOUT | Category |
@CODE | nvarchar(10) | INOUT | Code |
@CODEREGEX | nvarchar(255) | INOUT | Code regular expression |
@CODEVALUEID | uniqueidentifier | INOUT | Source code part definition value |
@VENDORID | uniqueidentifier | INOUT | Vendor |
@LOCATIONCOUNTRYID | uniqueidentifier | INOUT | Country |
@LOCATIONSTATEID | uniqueidentifier | INOUT | State |
@LOCATIONPOSTCODE | nvarchar(12) | INOUT | ZIP |
@LOCATIONCITY | nvarchar(50) | INOUT | City |
@LOCATIONADDRESSBLOCK | nvarchar(150) | INOUT | Address |
@IMPRESSIONS | int | INOUT | Impressions |
@IMPRESSIONCALCULATIONMETHODCODE | tinyint | INOUT | per |
@GROUPS | xml | INOUT | Assign this segment to the groups marked below |
@ISINUSE | bit | INOUT | Is in use |
@ALLOWCODEUPDATE | bit | INOUT | Allow code update? |
@SEGMENTPARTDEFINITIONID | uniqueidentifier | INOUT | Segment part definition ID |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@SITEID | uniqueidentifier | INOUT | Site |
@SITEREQUIRED | bit | INOUT | Site required? |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTMARKETINGLOCATION]
(
@ID uniqueidentifier,
@CURRENTAPPUSERID uniqueidentifier,
@DATALOADED bit = 0 output,
@QUERYVIEWCATALOGID uniqueidentifier = null output,
@NAME nvarchar(100) = null output,
@DESCRIPTION nvarchar(255) = null output,
@SEGMENTCATEGORYCODEID uniqueidentifier = null output,
@CODE nvarchar(10) = null output,
@CODEREGEX nvarchar(255) = null output,
@CODEVALUEID uniqueidentifier = null output,
@VENDORID uniqueidentifier = null output,
@LOCATIONCOUNTRYID uniqueidentifier = null output,
@LOCATIONSTATEID uniqueidentifier = null output,
@LOCATIONPOSTCODE nvarchar(12) = null output,
@LOCATIONCITY nvarchar(50) = null output,
@LOCATIONADDRESSBLOCK nvarchar(150) = null output,
@IMPRESSIONS integer = null output,
@IMPRESSIONCALCULATIONMETHODCODE tinyint = null output,
@GROUPS xml = null output,
@ISINUSE bit = null output,
@ALLOWCODEUPDATE bit = null output,
@SEGMENTPARTDEFINITIONID uniqueidentifier = null output,
@TSLONG bigint = 0 output,
@SITEID uniqueidentifier = null output,
@SITEREQUIRED bit = null output
)
as
set nocount on;
exec dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENT_2]
@ID,
@CURRENTAPPUSERID,
@DATALOADED output,
@NAME output,
@DESCRIPTION output,
@SEGMENTCATEGORYCODEID output,
@CODE output,
@QUERYVIEWCATALOGID output,
null,
@GROUPS output,
0,
@ISINUSE output,
null,
@ALLOWCODEUPDATE output,
@CODEVALUEID output,
@TSLONG output,
@SITEID output,
null;
if @DATALOADED = 1
begin
set @DATALOADED = 0;
select
@DATALOADED = 1,
@VENDORID = [MKTSEGMENTPASSIVE].[VENDORID],
@LOCATIONCOUNTRYID = [MKTSEGMENTPASSIVE].[LOCATIONCOUNTRYID],
@LOCATIONSTATEID = [MKTSEGMENTPASSIVE].[LOCATIONSTATEID],
@LOCATIONPOSTCODE = [MKTSEGMENTPASSIVE].[LOCATIONPOSTCODE],
@LOCATIONCITY = [MKTSEGMENTPASSIVE].[LOCATIONCITY],
@LOCATIONADDRESSBLOCK = [MKTSEGMENTPASSIVE].[LOCATIONADDRESSBLOCK],
@IMPRESSIONS = [MKTSEGMENTPASSIVE].[IMPRESSIONS],
@IMPRESSIONCALCULATIONMETHODCODE = [MKTSEGMENTPASSIVE].[IMPRESSIONCALCULATIONMETHODCODE]
from dbo.[MKTSEGMENTPASSIVE]
inner join dbo.[MKTSEGMENT] on [MKTSEGMENT].[ID] = [MKTSEGMENTPASSIVE].[ID]
where [MKTSEGMENTPASSIVE].[ID] = @ID
and [MKTSEGMENT].[SEGMENTTYPECODE] = 8;
end
if @DATALOADED = 1
begin
select @SEGMENTPARTDEFINITIONID = [ID] from dbo.[MKTSOURCECODEPARTDEFINITION] where [ITEMTYPECODE] = 1;
if @CODEVALUEID is not null
select @CODEREGEX = [REGEX] from dbo.[MKTSOURCECODEPARTDEFINITIONVALUES] where [ID] = @CODEVALUEID;
end
set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '38C5B1A7-DEA4-490E-9C1B-EC0532C7FA80', 1);
return 0;