USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPCANCELTRANSFER
The load procedure used by the edit dataform template "Cancel Pending Sponsorship Transfer Edit 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. |
@DONORNAME | nvarchar(100) | INOUT | Sponsor |
@HEADER | nvarchar(100) | INOUT | Cancellation reason |
@OPPORTUNITYNAME | nvarchar(100) | INOUT | Opportunities |
@REASONID | uniqueidentifier | INOUT | Reason |
Definition
Copy
CREATE procedure USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPCANCELTRANSFER
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@DONORNAME nvarchar(100) = null output,
@HEADER nvarchar(100) = null output,
@OPPORTUNITYNAME nvarchar(100) = null output,
@REASONID uniqueidentifier = null output
)
as
set nocount on;
set @DATALOADED = 0
set @TSLONG = 0
declare @FROMSPONSORSHIPID uniqueidentifier
declare @TOSPONSORSHIPID uniqueidentifier
exec dbo.USP_GETPENDINGTRANSFERSPONSORSHIPS
@ID,
@FROMSPONSORSHIPID output,
@TOSPONSORSHIPID output
if @FROMSPONSORSHIPID is not null and
@TOSPONSORSHIPID is not null
begin
declare @CONSTITUENTID uniqueidentifier=null;
declare @SPONSORSHIPOPPORTUNITYID uniqueidentifier=null;
--Get constituent id and opportunity id from sponsorship
select
@DATALOADED = 1,
@TSLONG = FROMSPONSORSHIP.TSLONG,
@CONSTITUENTID = FROMSPONSORSHIP.CONSTITUENTID,
@DONORNAME = NF.NAME,
@OPPORTUNITYNAME = dbo.UFN_SPONSORSHIPOPPORTUNITY_TRANSLATIONFUNCTION(FROMSPONSORSHIP.SPONSORSHIPOPPORTUNITYID) + ' (Active) / ' +
dbo.UFN_SPONSORSHIPOPPORTUNITY_TRANSLATIONFUNCTION(TOSPONSORSHIP.SPONSORSHIPOPPORTUNITYID) + ' (Pending)'
from
dbo.SPONSORSHIP FROMSPONSORSHIP
inner join dbo.SPONSORSHIP TOSPONSORSHIP on TOSPONSORSHIP.ID = @TOSPONSORSHIPID
cross apply dbo.UFN_CONSTITUENT_DISPLAYNAME(FROMSPONSORSHIP.CONSTITUENTID) NF
where
FROMSPONSORSHIP.ID = @FROMSPONSORSHIPID
and
FROMSPONSORSHIP.STATUSCODE = 1
end
return 0;