USP_DATAFORMTEMPLATE_VIEW_REGISTRANTRELATEDREGISTRATIONS
The load procedure used by the view dataform template "Registrant Related Registrations 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. |
@REGISTRANTNAME | nvarchar(124) | INOUT | [Not Used] |
@RELATEDREGISTRATIONS | xml | INOUT | Related Registrations |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_REGISTRANTRELATEDREGISTRATIONS
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@REGISTRANTNAME nvarchar(124) = null output,
@RELATEDREGISTRATIONS xml = null output,
@CURRENTAPPUSERID uniqueidentifier
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
select
@DATALOADED = 1,
@REGISTRANTNAME = coalesce(NAME, 'Unnamed Guest')
from
dbo.REGISTRANT
left outer join
dbo.CONSTITUENT on REGISTRANT.CONSTITUENTID = CONSTITUENT.ID
where
REGISTRANT.ID = @ID
if @DATALOADED = 1
set @RELATEDREGISTRATIONS = dbo.UFN_REGISTRANT_RELATEDREGISTRATIONS_TOITEMLISTXML(@ID, @CURRENTAPPUSERID)
else
-- prevent error when looking at an invitee
select @DATALOADED = 1
from dbo.INVITEE
where ID = @ID;
return 0;