USP_DATAFORMTEMPLATE_VIEW_SPONSORSHIPPROGRAM
The load procedure used by the view dataform template "Sponsorship Program Information View 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. |
@NAME | nvarchar(100) | INOUT | Name |
@SPONSORSHIPOPPORTUNITYTYPE | int | INOUT | Program type |
@GROUPNAME | nvarchar(100) | INOUT | Opportunity group |
@GREATESTNEEDRULESET | nvarchar(50) | INOUT | Greatest need rule set |
@COST | money | INOUT | Default monthly amount |
@STATUS | nvarchar(100) | INOUT | Status |
@BASECURRENCYID | uniqueidentifier | INOUT | BASECURRENCYID |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_SPONSORSHIPPROGRAM
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(100) =null output,
@SPONSORSHIPOPPORTUNITYTYPE int = null output,
@GROUPNAME nvarchar(100) = null output,
@GREATESTNEEDRULESET nvarchar(50) = null output,
@COST money = null output,
@STATUS nvarchar(100) = null output,
@BASECURRENCYID uniqueidentifier = null output
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
-- populate the output parameters, which correspond to fields on the form. Note that
-- we set @DATALOADED = 1 to indicate that the load was successful. Otherwise, the system
-- will display a "no data loaded" message.
select
@DATALOADED = 1,
@NAME = SP.NAME,
@SPONSORSHIPOPPORTUNITYTYPE = SG.SPONSORSHIPOPPORTUNITYTYPECODE,
@GROUPNAME = SG.NAME,
@GREATESTNEEDRULESET = SPONSORSHIPGREATESTNEEDRULESET.NAME,
@COST = SP.AMOUNT,
@STATUS = case when SP.ISINACTIVE = 1 then 'Inactive' else 'Active' end,
@BASECURRENCYID = SP.BASECURRENCYID
from dbo.SPONSORSHIPPROGRAM SP
inner join dbo.SPONSORSHIPOPPORTUNITYGROUP SG on SG.ID = SP.SPONSORSHIPOPPORTUNITYGROUPID
left join SPONSORSHIPGREATESTNEEDRULESET on SPONSORSHIPGREATESTNEEDRULESET.ID = SP.SPONSORSHIPGREATESTNEEDRULESETID
where @ID = SP.ID;
return 0;