USP_DATAFORMTEMPLATE_VIEW_PLANOUTLINESTEPSFORADDFORM

The load procedure used by the view dataform template "Plan Outline Steps for Add Prospect View Form"

Parameters

Parameter Parameter Type Mode Description
@ID nvarchar(72) 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.
@STEPS xml INOUT STEPS
@STEPOWNERS xml INOUT STEPOWNERS

Definition

Copy

                CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_PLANOUTLINESTEPSFORADDFORM (
                    @ID nvarchar(72),
                    @DATALOADED bit = 0 output,
                    @STEPS xml = null output,
                    @STEPOWNERS xml = null output
                ) as begin
                    set nocount on;

                    set @DATALOADED = 0;

                    declare @PLANOUTLINEID uniqueidentifier;
                    declare @PROSPECTID uniqueidentifier;
                    set @PLANOUTLINEID = substring(@ID,  1, 36);
                    set @PROSPECTID = substring(@ID, 37, 36);

                    select 
                        @DATALOADED = 1,
                        @STEPS = dbo.UFN_PLANOUTLINE_STEPSFORPROSPECT_TOITEMLISTXML(@PLANOUTLINEID, @PROSPECTID, getdate())
                    from
                        dbo.PLANOUTLINE
                    where
                        ID=@PLANOUTLINEID

                    set @STEPOWNERS = (
                        select
                            ID as PLANOUTLINESTEPID,
                            FUNDRAISERROLECODE
                        from dbo.PLANOUTLINESTEP
                        where PLANOUTLINEID=@PLANOUTLINEID
                        for xml raw('ITEM'),type,elements,root('STEPOWNERS'),BINARY BASE64
                    )

                    return 0;

                end