USP_DATAFORMTEMPLATE_ADDLOAD_PROSPECT
The load procedure used by the edit dataform template "Prospect Add Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CONSTITUENTID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@PROSPECTID | uniqueidentifier | INOUT | Constituent |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@PROSPECTPLAN_SITEREQUIRED | bit | INOUT | |
@PROSPECTTEAM | xml | INOUT | Prospect team |
@SITES | xml | INOUT | Sites |
@PROSPECTMANAGERFUNDRAISERID | uniqueidentifier | INOUT | Prospect manager |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADDLOAD_PROSPECT (
@CONSTITUENTID uniqueidentifier,
@PROSPECTID uniqueidentifier = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@PROSPECTPLAN_SITEREQUIRED bit = null output,
@PROSPECTTEAM xml = null output,
@SITES xml = null output,
@PROSPECTMANAGERFUNDRAISERID uniqueidentifier = null output
)
as
set nocount on;
if (exists(select 1 from dbo.CONSTITUENT where ID=@CONSTITUENTID))
begin
set @PROSPECTID = @CONSTITUENTID;
set @PROSPECTTEAM = dbo.UFN_PROSPECTTEAM_MEMBERS_TOITEMLISTXML(@CONSTITUENTID);
-- this param added here only and not in ProspectWithoutConstituent.Add.xml since that spec
-- is opened w/o a constituent filled in.
select @PROSPECTMANAGERFUNDRAISERID = PROSPECT.PROSPECTMANAGERFUNDRAISERID from dbo.PROSPECT where PROSPECT.ID = @CONSTITUENTID;
end
set @PROSPECTPLAN_SITEREQUIRED = dbo.UFN_SITEREQUIREDFORUSER(@CURRENTAPPUSERID)
declare @USERSITEID uniqueidentifier = dbo.UFN_APPUSER_DEFAULTSITEFORUSER(@CURRENTAPPUSERID)
if @USERSITEID is not null
begin
set @SITES = (
select newid() ID, @USERSITEID SITEID
for xml raw('ITEM'),type,elements,root('SITES'),BINARY BASE64
)
end
return 0;