USP_DATAFORMTEMPLATE_ADD_EXCHANGECALENDARITEMBATCHROW

The save procedure used by the add dataform template "Exchange Calendar Item Batch Row Add Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@BATCHID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@PROCESS bit IN Process
@SEQUENCE int IN Sequence
@RECORDTYPECODE int IN Record type
@CONSTITUENTID uniqueidentifier IN Constituent
@OWNERID uniqueidentifier IN User
@EXPECTEDDATE datetime IN Expected date
@OBJECTIVE nvarchar(256) IN Objective
@INTERACTIONID uniqueidentifier IN Interaction
@STEWARDSHIPSTEPID uniqueidentifier IN Stewardship step
@EXPECTEDSTARTTIME UDT_HOURMINUTE IN Expected start time
@EXPECTEDENDTIME UDT_HOURMINUTE IN Expected end time
@TIMEZONEENTRYID uniqueidentifier IN Time zone

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_EXCHANGECALENDARITEMBATCHROW
(
  @ID uniqueidentifier output,  
  @CHANGEAGENTID uniqueidentifier,
  @BATCHID uniqueidentifier,
  @PROCESS bit,
  @SEQUENCE int,
  @RECORDTYPECODE int,
  @CONSTITUENTID uniqueidentifier = null,
  @OWNERID uniqueidentifier = null,
  @EXPECTEDDATE datetime = null,
  @OBJECTIVE nvarchar(256) = null,
  @INTERACTIONID uniqueidentifier = null,
  @STEWARDSHIPSTEPID uniqueidentifier = null,
  @EXPECTEDSTARTTIME dbo.UDT_HOURMINUTE = null,
  @EXPECTEDENDTIME dbo.UDT_HOURMINUTE = null,
  @TIMEZONEENTRYID uniqueidentifier = null
)
as 
  set nocount on;

  declare @CHANGEDATE datetime

  if @ID is null
    set @ID = NewID();

  if @CHANGEAGENTID is null
    exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

  set @CHANGEDATE = getdate();

  begin try
    insert into dbo.EXCHANGECALENDARITEMBATCH(ID, PROCESS, RECORDTYPECODE, SEQUENCE, BATCHID, CONSTITUENTID, OWNERID, EXPECTEDDATE, OBJECTIVE, INTERACTIONID, STEWARDSHIPSTEPID, CHANGEDBYID, DATECHANGED, ADDEDBYID, DATEADDED, EXPECTEDSTARTTIME, EXPECTEDENDTIME,TIMEZONEENTRYID)
  values(@ID, @PROCESS, @RECORDTYPECODE, @SEQUENCE, @BATCHID, @CONSTITUENTID, @OWNERID, @EXPECTEDDATE, @OBJECTIVE, @INTERACTIONID, @STEWARDSHIPSTEPID, @CHANGEAGENTID, @CHANGEDATE, @CHANGEAGENTID, @CHANGEDATE, @EXPECTEDSTARTTIME, @EXPECTEDENDTIME, @TIMEZONEENTRYID);

  end try
  begin catch
    exec dbo.USP_RAISE_ERROR;
    return 1;
  end catch

  return 0;