USP_DATAFORMTEMPLATE_EDITSAVE_EXCHANGEEMAILBATCHROW_2
The save procedure used by the edit dataform template "Exchange Email Batch Row Edit Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@ADDASINTERACTION | bit | IN | Add as interaction |
@SEQUENCE | int | IN | Sequence |
@SITES | xml | IN | Sites |
@CONSTITUENTID | uniqueidentifier | IN | Constituent |
@USERID | uniqueidentifier | IN | User |
@DATESENT | datetime | IN | Date |
@TIMESENT | UDT_HOURMINUTE | IN | Time |
@SUBJECT | nvarchar(256) | IN | Subject |
@BODY | nvarchar(max) | IN | Body |
@INTERACTIONTYPECODEID | uniqueidentifier | IN | Type |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITSAVE_EXCHANGEEMAILBATCHROW_2
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier,
@ADDASINTERACTION bit,
@SEQUENCE int,
@SITES xml,
@CONSTITUENTID uniqueidentifier,
@USERID uniqueidentifier,
@DATESENT datetime,
@TIMESENT UDT_HOURMINUTE,
@SUBJECT nvarchar(256),
@BODY nvarchar(max),
@INTERACTIONTYPECODEID uniqueidentifier
)
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
update dbo.EXCHANGEEMAILBATCH
set ADDASINTERACTION = @ADDASINTERACTION,
SEQUENCE = @SEQUENCE,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CHANGEDATE
where ID = @ID;
exec dbo.USP_EXCHANGEEMAILBATCH_GETSITES_UPDATEFROMXML @ID, @SITES, @CHANGEAGENTID, @CHANGEDATE;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;