USP_DATAFORMTEMPLATE_EDITLOAD_GENERATESTEPUPDATEBATCHPROCESS

The load procedure used by the edit dataform template "Generate Step Update Batch Process 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.
@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.
@NAME nvarchar(100) INOUT Name
@IDSETREGISTERID uniqueidentifier INOUT Step selection
@BATCHTEMPLATEID uniqueidentifier INOUT Batch template
@BATCHNUMBER nvarchar(100) INOUT Batch number
@OVERRIDEBATCHNUMBER bit INOUT Override
@DESCRIPTION nvarchar(1000) INOUT Description
@OWNERID uniqueidentifier INOUT Owner
@AUTOSAVEONROWCHANGE bit INOUT Enable auto save
@FIELDSTOUPDATE xml INOUT Updates
@OFFSET smallint INOUT move target dates
@MOVECODE tinyint INOUT Move target dates
@DATEVALUEUNITCODE tinyint INOUT Date value unit code
@CANCHANGEBATCHNUMBERS bit INOUT
@RECORDTYPEID uniqueidentifier INOUT

Definition

Copy

CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_GENERATESTEPUPDATEBATCHPROCESS
(
  @ID uniqueidentifier,
  @CURRENTAPPUSERID uniqueidentifier,
  @DATALOADED bit = 0 output,
  @TSLONG bigint = 0 output,
  @NAME nvarchar(100) = null output,
  @IDSETREGISTERID uniqueidentifier = null output,
  @BATCHTEMPLATEID uniqueidentifier = null output,
  @BATCHNUMBER nvarchar(100) = null output,
  @OVERRIDEBATCHNUMBER bit = null output,
  @DESCRIPTION nvarchar(1000) = null output,
  @OWNERID uniqueidentifier = null output,
  @AUTOSAVEONROWCHANGE bit = null output,
  @FIELDSTOUPDATE xml = null output,
  @OFFSET smallint = null output,
  @MOVECODE tinyint = null output,
  @DATEVALUEUNITCODE tinyint = null output,
  @CANCHANGEBATCHNUMBERS bit = null output,
  @RECORDTYPEID uniqueidentifier = null output
)
as

  set nocount on;

  set @DATALOADED = 0
  set @TSLONG = 0

  select
    @DATALOADED = 1,
    @NAME = NAME,
    @IDSETREGISTERID = IDSETREGISTERID,
    @BATCHTEMPLATEID = BATCHTEMPLATEID,
    @BATCHNUMBER = BATCHNUMBER,
    @OVERRIDEBATCHNUMBER = OVERRIDEBATCHNUMBER,
    @DESCRIPTION = DESCRIPTION,
    @OWNERID = APPUSERID,
    @AUTOSAVEONROWCHANGE = AUTOSAVEONROWCHANGE,
    @FIELDSTOUPDATE = FIELDSTOUPDATE,
    @OFFSET = OFFSET,
    @MOVECODE = MOVECODE,
    @DATEVALUEUNITCODE = DATEVALUEUNITCODE,
    @CANCHANGEBATCHNUMBERS = dbo.UFN_SECURITY_APPUSER_GRANTED_CHANGEBATCHNUMBER(@CURRENTAPPUSERID, BATCHTEMPLATEID),
    @TSLONG = GENERATESTEPUPDATEBATCHPROCESS.TSLONG
  from dbo.GENERATESTEPUPDATEBATCHPROCESS
  where GENERATESTEPUPDATEBATCHPROCESS.ID = @ID;

  select 
    @RECORDTYPEID = ID 
  from dbo.RECORDTYPE 
  where upper(NAME) = 'STEWARDSHIP PLAN STEP';

  return 0;