USP_DATAFORMTEMPLATE_EDIT_TEAM_EXTENSION
The save procedure used by the edit dataform template "Team Extension Edit Form".
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
| @CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
| @TEAMFUNDRAISINGTEAMID | uniqueidentifier | IN | Team |
| @EVENTID | uniqueidentifier | IN | Event |
| @PARTICIPANTGOAL | int | IN | Total Participant Goal |
| @TEAMMEMBERGOAL | int | IN | Teammember Retention Goal |
| @VOLUNTEERGOAL | int | IN | Total Volunteer Recruitment Goal |
| @COMMUNICATIONGOAL | int | IN | Communication Goal |
| @OTHERGOAL | int | IN | Custom Goal |
| @PCTTEAMMEMBERRETENSION | decimal(5, 2) | IN | Percentage of Team Members to retain |
| @TEAMRECRUITMENTGOAL | int | IN | Total number of Teams in a Company |
| @PCTTEAMSRETENSION | decimal(5, 2) | IN | Percentage of Teams to retain in a Company |
| @STATUSCODE | tinyint | IN | Status |
| @FAFFUNDRAISINGGAUGEID | uniqueidentifier | IN | FafFundraisingGaugeID |
| @TYPECODE | tinyint | IN | Type |
| @HOUSEHOLDID | uniqueidentifier | IN | Household |
| @TARGETFUNDRAISINGGOAL | money | IN | TargetFundraisingGoal |
| @DONORRETENTIONGOAL | decimal(5, 2) | IN | DonorRetentionGoal |
| @TEAMCONSTITUENTID | uniqueidentifier | IN | TeamConstituentid |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_TEAM_EXTENSION
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@TEAMFUNDRAISINGTEAMID uniqueidentifier,
@EVENTID uniqueidentifier,
@PARTICIPANTGOAL int,
@TEAMMEMBERGOAL int,
@VOLUNTEERGOAL int,
@COMMUNICATIONGOAL int,
@OTHERGOAL int,
@PCTTEAMMEMBERRETENSION decimal(5,2),
@TEAMRECRUITMENTGOAL int,
@PCTTEAMSRETENSION decimal(5,2),
@STATUSCODE tinyint,
@FAFFUNDRAISINGGAUGEID uniqueidentifier,
@TYPECODE tinyint,
@HOUSEHOLDID uniqueidentifier,
@TARGETFUNDRAISINGGOAL money,
@DONORRETENTIONGOAL decimal(5,2),
@TEAMCONSTITUENTID uniqueidentifier
)
as
set nocount on;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
begin try
-- handle updating the data
update dbo.TEAMEXTENSION set
TEAMFUNDRAISINGTEAMID = @TEAMFUNDRAISINGTEAMID,
EVENTID = @EVENTID,
PARTICIPANTGOAL = @PARTICIPANTGOAL,
TEAMMEMBERGOAL = @TEAMMEMBERGOAL,
VOLUNTEERGOAL = @VOLUNTEERGOAL,
COMMUNICATIONGOAL = @COMMUNICATIONGOAL,
OTHERGOAL = @OTHERGOAL,
PCTTEAMMEMBERRETENSION = @PCTTEAMMEMBERRETENSION,
TEAMRECRUITMENTGOAL = @TEAMRECRUITMENTGOAL,
PCTTEAMSRETENSION = @PCTTEAMSRETENSION,
STATUSCODE = @STATUSCODE,
FAFFUNDRAISINGGAUGEID = @FAFFUNDRAISINGGAUGEID,
TYPECODE = @TYPECODE,
HOUSEHOLDID = @HOUSEHOLDID,
TARGETFUNDRAISINGGOAL = @TARGETFUNDRAISINGGOAL,
DONORRETENTIONGOAL = @DONORRETENTIONGOAL,
TEAMCONSTITUENTID = @TEAMCONSTITUENTID,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = getdate()
where ID = @ID
IF @STATUSCODE = 0
UPDATE CONSTITUENT
set ISINACTIVE = 0
WHERE ID = @TEAMCONSTITUENTID
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;