USP_DATAFORMTEMPLATE_EDITLOAD_MKTMARKETINGPLANTEMPLATE_2

The load procedure used by the edit dataform template "Marketing Plan Template Edit Form 2"

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(50) INOUT Name
@SITEID uniqueidentifier INOUT Site
@ISDEFAULT bit INOUT Use this template as the default for new marketing plans
@ITEMLIST xml INOUT Items
@SITEREQUIRED bit INOUT Site required?
@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.

Definition

Copy


CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTMARKETINGPLANTEMPLATE_2]
(
  @ID uniqueidentifier,
  @CURRENTAPPUSERID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @NAME nvarchar(50) = null output,
  @SITEID uniqueidentifier = null output,
  @ISDEFAULT bit = null output,
  @ITEMLIST xml = null output,
  @SITEREQUIRED bit = null output,
  @TSLONG bigint = 0 output
)
as
begin
  set nocount on;

  set @DATALOADED = 0;
  set @TSLONG = 0;

  select
    @DATALOADED = 1,
    @NAME = [NAME],
    @SITEID = [SITEID],
    @ISDEFAULT = [ISDEFAULT],
    @ITEMLIST = dbo.[UFN_MKTMARKETINGPLANTEMPLATE_GETITEMLIST_TOITEMLISTXML]([ID]),
    @TSLONG = [TSLONG]
  from dbo.[MKTMARKETINGPLANTEMPLATE]
  where ID = @ID;

  set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '800f626f-461b-42c1-9814-9402a70f9a38', 1);

  return 0;
end