USP_DATAFORMTEMPLATE_ADD_CONSTITUENTRECOGNITIONDEFAULTBYRECIPIENT
The save procedure used by the add dataform template "Constituent Recognition Default By Recipient Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CONSTITUENTID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@RECIPIENTCONSTITUENTID | uniqueidentifier | IN | Constituent |
@PRIMARYRECOGNITIONDEFAULTEXISTS | bit | IN | Apply to <Constituent> for revenue from <Reciprocal> |
@PRIMARYRECOGNITIONMATCHFACTOR | decimal(5, 2) | IN | Recognition credit match percent |
@PRIMARYRECOGNITIONTYPECODEID | uniqueidentifier | IN | Recognition credit type |
@RECIPROCALRECOGNITIONDEFAULTEXISTS | bit | IN | Apply to <Reciprocal> for revenue from <Constituent> |
@RECIPROCALRECOGNITIONMATCHFACTOR | decimal(5, 2) | IN | Recognition credit match percent |
@RECIPROCALRECOGNITIONTYPECODEID | uniqueidentifier | IN | Recognition credit type |
@STARTDATE | datetime | IN | Start date |
@ENDDATE | datetime | IN | End date |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_CONSTITUENTRECOGNITIONDEFAULTBYRECIPIENT
(
@ID uniqueidentifier output,
@CONSTITUENTID uniqueidentifier,
@RECIPIENTCONSTITUENTID uniqueidentifier,
@PRIMARYRECOGNITIONDEFAULTEXISTS bit = 0,
@PRIMARYRECOGNITIONMATCHFACTOR decimal(5, 2) = 100,
@PRIMARYRECOGNITIONTYPECODEID uniqueidentifier = null,
@RECIPROCALRECOGNITIONDEFAULTEXISTS bit = 1,
@RECIPROCALRECOGNITIONMATCHFACTOR decimal(5, 2) = 100,
@RECIPROCALRECOGNITIONTYPECODEID uniqueidentifier = null,
@STARTDATE datetime = null,
@ENDDATE datetime = null,
@CHANGEAGENTID uniqueidentifier
)
as
set nocount on;
declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
if @ID is null
set @ID = newid()
begin try
exec dbo.USP_RECOGNITIONDEFAULTSUPDATE @CONSTITUENTID, @RECIPIENTCONSTITUENTID,
@STARTDATE, @ENDDATE, @PRIMARYRECOGNITIONDEFAULTEXISTS, @PRIMARYRECOGNITIONMATCHFACTOR,
@PRIMARYRECOGNITIONTYPECODEID, @RECIPROCALRECOGNITIONDEFAULTEXISTS,
@RECIPROCALRECOGNITIONMATCHFACTOR, @RECIPROCALRECOGNITIONTYPECODEID, @CHANGEAGENTID;
-- there should be only one row.
select top 1
@ID = ID
from dbo.REVENUERECOGNITIONDEFAULT
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch