USP_DATAFORMTEMPLATE_EDITLOAD_DESIGNATIONLEVELGIFTFEEOPTION
The load procedure used by the edit dataform template "Fundraising Purpose Gift Fee Option Edit Data Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@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. |
@ENABLED | bit | INOUT | Apply gift fees to revenue |
@APPLICATIONTYPES | xml | INOUT | Apply fees to the following payment application types |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_DESIGNATIONLEVELGIFTFEEOPTION(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@ENABLED bit = null output,
@APPLICATIONTYPES xml = null output
)
as
set nocount on;
set @DATALOADED = 1;
set @TSLONG = 0;
set @ENABLED = 0;
select top 1
@TSLONG = TSLONG,
@ENABLED = ENABLED,
@APPLICATIONTYPES = dbo.UFN_DESIGNATIONLEVELGIFTFEE_GETAPPLICATIONTYPES_TOITEMLISTXML(@ID)
from dbo.DESIGNATIONLEVELGIFTFEEOPTION
where ID = @ID
if @@ROWCOUNT = 0
begin
--KevinKoe - WI 135950 - make the same select as UFN_GIFTFEE_GETAPPLICATIONTYPES_TOITEMLISTXML to get the default types, but use
-- empty guid, so that a new record gets inserted for the application code upon save
declare @DEFAULTGIFTFEEAPPLICATIONTYPES xml = (SELECT [APPLICATIONCODE], '00000000-0000-0000-0000-000000000000'
FROM dbo.[UFN_GIFTFEE_GETAPPLICATIONTYPES]()
where [APPLICATIONCODE] in (0,1,2,3,4,5,6,7,8,10,12,13,15)
for xml raw('ITEM'),type,elements,root('APPLICATIONTYPES'),BINARY BASE64);
select top 1
@TSLONG = TSLONG,
@ENABLED = ENABLED,
@APPLICATIONTYPES = @DEFAULTGIFTFEEAPPLICATIONTYPES
from dbo.GIFTFEEOPTION
end
return 0;