USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTSPONSORSHIP

The load procedure used by the edit dataform template "Sponsorship Segment 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.
@NAME nvarchar(100) INOUT Name
@DESCRIPTION nvarchar(255) INOUT Description
@SEGMENTCATEGORYCODEID uniqueidentifier INOUT Category
@CODE nvarchar(10) INOUT Code
@QUERYVIEWCATALOGID uniqueidentifier INOUT Record source
@SELECTIONS xml INOUT Selections
@GROUPS xml INOUT Groups
@SMARTQUERIESEXIST bit INOUT Smart queries exist
@ISINUSE bit INOUT Is in use
@SELECTIONTYPE tinyint INOUT Selection type
@DATECHANGED datetime INOUT Date changed
@ALLOWCODEUPDATE bit INOUT Allow code update?
@CODEVALUEID uniqueidentifier INOUT Code value 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?
@SEGMENTPARTDEFINITIONID uniqueidentifier INOUT

Definition

Copy


CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTSPONSORSHIP]
(
  @ID uniqueidentifier,
  @CURRENTAPPUSERID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @NAME nvarchar(100) = null output,
  @DESCRIPTION nvarchar(255) = null output,
  @SEGMENTCATEGORYCODEID uniqueidentifier = null output,
  @CODE nvarchar(10) = null output,
  @QUERYVIEWCATALOGID uniqueidentifier = null output,
  @SELECTIONS xml = null output,
  @GROUPS xml = null output,
  @SMARTQUERIESEXIST bit = null output,
  @ISINUSE bit = null output,
  @SELECTIONTYPE tinyint = null output,
  @DATECHANGED datetime = null output,
  @ALLOWCODEUPDATE bit = null output,
  @CODEVALUEID uniqueidentifier = null output,
  @TSLONG bigint = 0 output,
  @SITEID uniqueidentifier = null output,
  @SITEREQUIRED bit = null output,
  @SEGMENTPARTDEFINITIONID uniqueidentifier = null output
)
as
  set nocount on;

  set @SELECTIONTYPE = 4;

  -- load the segment

  exec dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENT_2]
    @ID,
    @CURRENTAPPUSERID,
    @DATALOADED output,
    @NAME output,
    @DESCRIPTION output,
    @SEGMENTCATEGORYCODEID output,
    @CODE output,
    @QUERYVIEWCATALOGID output,
    @SELECTIONS output,
    @GROUPS output,
    @SMARTQUERIESEXIST output,
    @ISINUSE output,
    @DATECHANGED output,
    @ALLOWCODEUPDATE output,
    @CODEVALUEID output,
    @TSLONG output,
    @SITEID output,
    null;

  set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '293d1591-8299-42c5-a53d-1269b6c6a4c4', 1);

  select @SEGMENTPARTDEFINITIONID = [ID] from dbo.[MKTSOURCECODEPARTDEFINITION] where [ITEMTYPECODE] = 1;

  return 0;