USP_DATAFORMTEMPLATE_EDITLOAD_CONSTITUENTRECOGNITIONDEFAULTBYRECIPIENT
The load procedure used by the edit dataform template "Constituent Recognition Default By Recipient Edit Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@CONSTITUENTNAME | nvarchar(154) | INOUT | Constituent |
@MATCHFACTOR | decimal(5, 2) | INOUT | Match percent |
@STARTDATE | datetime | INOUT | Start date |
@ENDDATE | datetime | INOUT | End date |
@REVENUERECOGNITIONTYPECODEID | uniqueidentifier | INOUT | Recognition credit type |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_CONSTITUENTRECOGNITIONDEFAULTBYRECIPIENT
(
@ID uniqueidentifier,
@CONSTITUENTNAME nvarchar(154) = null output,
@MATCHFACTOR decimal(5, 2) = null output,
@STARTDATE datetime = null output,
@ENDDATE datetime = null output,
@REVENUERECOGNITIONTYPECODEID uniqueidentifier = null output,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output
)
as
set nocount on
if(select PREVENTRECOGNITIONSDEFAULTING from dbo.REVENUERECOGNITIONDEFAULT where ID = @ID) = 0
begin
select
@CONSTITUENTNAME = NF.NAME,
@MATCHFACTOR = RM.MATCHFACTOR,
@STARTDATE = RM.STARTDATE,
@ENDDATE = RM.ENDDATE,
@TSLONG = RM.TSLONG,
@REVENUERECOGNITIONTYPECODEID = RM.REVENUERECOGNITIONTYPECODEID,
@DATALOADED = 1
from dbo.REVENUERECOGNITIONDEFAULT RM
outer apply dbo.UFN_CONSTITUENT_DISPLAYNAME(RM.SOURCECONSTITUENTID) NF
where RM.ID = @ID
end
else
begin
set @DATALOADED = 0;
end