USP_DATAFORM_ADD_CONSTITUENTSOLICITCODE
The save procedure used by the add dataform template "Constituent Solicit Code Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@SOLICITCODEID | uniqueidentifier | IN | Solicit code |
@CONSTITUENTID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@STARTDATE | datetime | IN | Start date |
@ENDDATE | datetime | IN | End date |
@COMMENTS | nvarchar(100) | IN | Comments |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@CONSENTPREFERENCECODE | tinyint | IN | |
@SOURCEEVIDENCECODEID | uniqueidentifier | IN | |
@SOURCEFILE | nvarchar(260) | IN | |
@PRIVACYPOLICY | nvarchar(260) | IN | |
@SUPPORTINGINFORMATION | nvarchar(max) | IN | |
@CONSENTSTATEMENT | nvarchar(max) | IN |
Definition
Copy
CREATE procedure dbo.USP_DATAFORM_ADD_CONSTITUENTSOLICITCODE
(
@ID uniqueidentifier = null output,
@SOLICITCODEID uniqueidentifier = null,
@CONSTITUENTID uniqueidentifier ,
@STARTDATE datetime =null,
@ENDDATE datetime=null,
@COMMENTS nvarchar(100) = '',
@CHANGEAGENTID uniqueidentifier = null,
@CONSENTPREFERENCECODE tinyint = 0,
@SOURCEEVIDENCECODEID uniqueidentifier = null,
@SOURCEFILE nvarchar(260) = '',
@PRIVACYPOLICY nvarchar(260) = '',
@SUPPORTINGINFORMATION nvarchar(max) = '',
@CONSENTSTATEMENT nvarchar(max) = ''
)
as
set nocount on;
if @ID is null
set @ID = newid();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
begin try
exec dbo.USP_CONSTITUENTSOLICITCODE_ADD
@ID output,
@SOLICITCODEID,
@CONSTITUENTID,
@STARTDATE,
@ENDDATE,
@COMMENTS,
@CHANGEAGENTID,
@CONSENTPREFERENCECODE,
@SOURCEEVIDENCECODEID,
@SOURCEFILE,
@PRIVACYPOLICY,
@SUPPORTINGINFORMATION,
@CONSENTSTATEMENT;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;