USP_DATAFORMTEMPLATE_EDIT_CONSTITUENTMERGEPROCESS

The save procedure used by the edit dataform template "Constituent Merge Process Edit Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@NAME nvarchar(100) IN Name
@DESCRIPTION nvarchar(255) IN Description
@MERGECONFIGURATIONID uniqueidentifier IN Merge configuration
@SOURCETABLEID uniqueidentifier IN Duplicate record source
@TARGETCRITERIA tinyint IN Target constituent criteria
@FILTERSELECTIONID uniqueidentifier IN Excluded constituents
@MINSIMILARITY decimal(3, 2) IN Minimum match %
@DELETEDUPES bit IN Delete source constituents
@INDIVIDUALSONLY bit IN Only merge individuals
@OMITINDORGMATCHES bit IN Omit individual/organization matches
@CREATEOUTPUTIDSET bit IN Create selection from results
@OUTPUTIDSETNAME nvarchar(100) IN Selection name
@OVERWRITEOUTPUTIDSET bit IN Overwrite existing selection

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_CONSTITUENTMERGEPROCESS
                    (
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @NAME nvarchar(100),
                        @DESCRIPTION nvarchar(255),
                        @MERGECONFIGURATIONID uniqueidentifier,
                        @SOURCETABLEID uniqueidentifier,
                        @TARGETCRITERIA tinyint,
                        @FILTERSELECTIONID uniqueidentifier,
                        @MINSIMILARITY decimal(3,2),
                        @DELETEDUPES bit,
                        @INDIVIDUALSONLY bit,
                        @OMITINDORGMATCHES bit,
                        @CREATEOUTPUTIDSET bit,
                        @OUTPUTIDSETNAME nvarchar(100),
                        @OVERWRITEOUTPUTIDSET bit
                    )
                    as
                        set nocount on;

                        declare @CURRENTDATE datetime;
                        set @CURRENTDATE = getdate();

                        if @CHANGEAGENTID is null  
                            exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;

                        begin try
                            update
                                dbo.CONSTITUENTMERGEPROCESS
                            set
                                NAME = @NAME,
                                DESCRIPTION = @DESCRIPTION,
                                MERGECONFIGURATIONID = @MERGECONFIGURATIONID,
                                 SOURCETABLEID = @SOURCETABLEID,
                                TARGETCRITERIA = @TARGETCRITERIA,
                                FILTERSELECTIONID = @FILTERSELECTIONID,
                                MINSIMILARITY = @MINSIMILARITY,
                                DELETEDUPES = @DELETEDUPES,
                                INDIVIDUALSONLY = @INDIVIDUALSONLY,
                                OMITINDORGMATCHES = @OMITINDORGMATCHES,
                                CREATEOUTPUTIDSET = @CREATEOUTPUTIDSET,
                                OUTPUTIDSETNAME = @OUTPUTIDSETNAME,
                                OVERWRITEOUTPUTIDSET = @OVERWRITEOUTPUTIDSET
                            where
                                ID = @ID;
                        end try
                        begin catch
                            exec dbo.USP_RAISE_ERROR;
                            return 1;
                        end catch

                        return 0;