USP_DATAFORMTEMPLATE_EDITLOAD_TRIBUTE

The load procedure used by the edit dataform template "Tribute Edit 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.
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.
@TRIBUTETYPECODEID uniqueidentifier INOUT Tribute type
@TRIBUTETEXT nvarchar(255) INOUT Tribute text
@TRIBUTEEID uniqueidentifier INOUT Tributee
@NAMEFORMATFUNCTIONID uniqueidentifier INOUT Name format
@DESIGNATIONID uniqueidentifier INOUT Default designation
@ISORGANIZATION bit INOUT ISORGANIZATION
@SITES xml INOUT Sites
@SITEREQUIRED bit INOUT Site Required
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@TRIBUTELETTERCODEID uniqueidentifier INOUT

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_TRIBUTE
                    (
                        @ID uniqueidentifier,
                        @DATALOADED bit = 0 output,
                        @TSLONG bigint = 0 output,
                        @TRIBUTETYPECODEID uniqueidentifier = null output,
                        @TRIBUTETEXT nvarchar(255) = null output,
                        @TRIBUTEEID uniqueidentifier = null output,
                        @NAMEFORMATFUNCTIONID uniqueidentifier = null output,
                        @DESIGNATIONID uniqueidentifier = null output,
                        @ISORGANIZATION bit = null output,
                        @SITES xml = null output,
                        @SITEREQUIRED bit = null output,
                        @CURRENTAPPUSERID uniqueidentifier,
                        @TRIBUTELETTERCODEID uniqueidentifier = null output
                    )
                    as

                        set nocount on;

                        set @DATALOADED = 0
                        set @TSLONG = 0

                        select
                            @TRIBUTETYPECODEID = TRIBUTETYPECODEID,
                            @TRIBUTETEXT = TRIBUTETEXT,
                            @TRIBUTEEID = TRIBUTEEID,
                            @DESIGNATIONID = DESIGNATIONID,
                            @NAMEFORMATFUNCTIONID = NAMEFORMATFUNCTIONID,
                            @DATALOADED = 1,
                            @TSLONG = TRIBUTE.TSLONG,
                            @ISORGANIZATION = CONSTITUENT.ISORGANIZATION,
                            @SITES = dbo.UFN_TRIBUTE_GETSITES_TOITEMLISTXML(TRIBUTE.ID),
                            @SITEREQUIRED =  dbo.UFN_SITEREQUIREDFORUSER(@CURRENTAPPUSERID),
                            @TRIBUTELETTERCODEID = TRIBUTEACKNOWLEDGEE.TRIBUTELETTERCODEID
                        from 
                            dbo.TRIBUTE
                        left join
                            dbo.CONSTITUENT on TRIBUTE.TRIBUTEEID = CONSTITUENT.ID
                        left join
                            dbo.TRIBUTEACKNOWLEDGEE on (TRIBUTEACKNOWLEDGEE.TRIBUTEID = TRIBUTE.ID and
                                                        TRIBUTEACKNOWLEDGEE.CONSTITUENTID = TRIBUTE.TRIBUTEEID)
                        where
                            TRIBUTE.ID = @ID;

                        return 0;