USP_DATAFORMTEMPLATE_EDITLOAD_MKTSOURCECODE_2

The load procedure used by the edit dataform template "Source Code 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(100) INOUT Name
@SITEID uniqueidentifier INOUT Site
@ISDEFAULT bit INOUT Use this layout as the default
@SITEREQUIRED bit INOUT Site required?
@DESCRIPTION nvarchar(255) INOUT Description
@INUSE bit INOUT Is in use
@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.
@ISHISTORICAL bit INOUT

Definition

Copy

CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSOURCECODE_2]
(
  @ID uniqueidentifier,
  @CURRENTAPPUSERID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @NAME nvarchar(100) = null output,
  @SITEID uniqueidentifier = null output,
  @ISDEFAULT bit = null output,
  @SITEREQUIRED bit = null output,
  @DESCRIPTION nvarchar(255) = null output,
  @INUSE bit = null output,
  @TSLONG bigint = 0 output,
  @ISHISTORICAL bit = null output
)
as
  set nocount on;

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

  select 
    @DATALOADED = 1,
    @NAME = [NAME],
    @SITEID = [SITEID],
    @ISDEFAULT = [ISDEFAULT],
    @DESCRIPTION = [DESCRIPTION],
    @ISHISTORICAL = [ISHISTORICAL],
    @TSLONG = [TSLONG]                        
  from dbo.[MKTSOURCECODE]
  where [ID] = @ID;

  set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '4e195902-d8bc-43f6-82e4-7d62e569394a', 1);

  set @INUSE = dbo.[UFN_MKTSOURCECODE_INUSE](@ID);

  return 0;