USP_DATAFORMTEMPLATE_VIEW_PROSPECTRESEARCHREQUESTCONSTITUENTPAGEEXPRESSION
The load procedure used by the view dataform template "Prospect Research Request Constituent Page Expression View"
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. |
@REQUESTNO | nvarchar(100) | INOUT | Request ID |
@CONSTITUENT | nvarchar(700) | INOUT | Prospect |
@CONSTITUENTID | uniqueidentifier | INOUT | Constituent ID |
@PROSPECTRESEARCHREQUESTID | uniqueidentifier | INOUT | Prospect research request ID |
@PARENTREQUESTNO | int | INOUT | Parent request ID |
@STATUSCODE | tinyint | INOUT | Status code |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_PROSPECTRESEARCHREQUESTCONSTITUENTPAGEEXPRESSION
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@REQUESTNO nvarchar(100) = null output,
@CONSTITUENT nvarchar(700) = null output,
@CONSTITUENTID uniqueidentifier = null output,
@PROSPECTRESEARCHREQUESTID uniqueidentifier = null output,
@PARENTREQUESTNO int = null output,
@STATUSCODE tinyint = null output
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
select
@DATALOADED = 1,
@REQUESTNO = PRRC.REQUESTNO,
@CONSTITUENT = NF.NAME,
@CONSTITUENTID = PRRC.CONSTITUENTID,
@PROSPECTRESEARCHREQUESTID = PRRC.PROSPECTRESEARCHREQUESTID,
@PARENTREQUESTNO = PRR.REQUESTNO,
@STATUSCODE = PRRC.STATUSCODE
from
dbo.PROSPECTRESEARCHREQUESTCONSTITUENT PRRC
outer apply dbo.UFN_CONSTITUENT_DISPLAYNAME(PRRC.CONSTITUENTID) NF
left join
dbo.PROSPECTRESEARCHREQUEST PRR on PRR.ID = PRRC.PROSPECTRESEARCHREQUESTID
where PRRC.ID = @ID
return 0;