USP_DATAFORMTEMPLATE_ADD_REVENUETRIBUTELETTER
The save procedure used by the add dataform template "Revenue Tribute Letter 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. |
@REVENUETRIBUTEID | uniqueidentifier | IN | Tribute |
@CONSTITUENTID | uniqueidentifier | IN | Acknowledgee |
@TRIBUTELETTERCODEID | uniqueidentifier | IN | Tribute letter |
@ACKNOWLEDGEDATE | datetime | IN | Acknowledge date |
@REVENUEID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_REVENUETRIBUTELETTER
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier,
@REVENUETRIBUTEID uniqueidentifier,
@CONSTITUENTID uniqueidentifier,
@TRIBUTELETTERCODEID uniqueidentifier,
@ACKNOWLEDGEDATE datetime = null,
@REVENUEID uniqueidentifier
)
as
set nocount on;
declare @CURRENTDATE datetime;
set @CURRENTDATE = GetDate();
if @ID is null
set @ID = NewID();
begin try
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
insert into dbo.REVENUETRIBUTELETTER(ID,REVENUETRIBUTEID,CONSTITUENTID,TRIBUTELETTERCODEID,ACKNOWLEDGEDATE,ADDEDBYID,CHANGEDBYID,DATEADDED,DATECHANGED)
values
(@ID,@REVENUETRIBUTEID,@CONSTITUENTID,@TRIBUTELETTERCODEID,@ACKNOWLEDGEDATE,@CHANGEAGENTID,@CHANGEAGENTID,@CURRENTDATE,@CURRENTDATE);
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;