USP_DATAFORMTEMPLATE_EDIT_CONSTITUENTMERGEPROCESSPREPROCESS_2

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

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.
@SOURCETABLEID uniqueidentifier IN Duplicate record source
@FILTERSELECTIONID uniqueidentifier IN Excluded constituents
@MINSIMILARITY decimal(3, 2) IN Minimum match %
@DELETEDUPES bit IN Delete source constituents
@CREATEOUTPUTIDSET bit IN Create selection from results
@OUTPUTIDSETNAME nvarchar(100) IN Selection name
@OVERWRITEOUTPUTIDSET bit IN Overwrite existing selection
@CONSTITUENTINACTIVITYREASONCODEID uniqueidentifier IN Inactive reason
@CONSTITUENTINACTIVITYDETAILS nvarchar(300) IN Inactive details

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_CONSTITUENTMERGEPROCESSPREPROCESS_2
                    (
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @SOURCETABLEID uniqueidentifier,
                        @FILTERSELECTIONID uniqueidentifier,
                        @MINSIMILARITY decimal(3,2),
                        @DELETEDUPES bit,
                        @CREATEOUTPUTIDSET bit,
                        @OUTPUTIDSETNAME nvarchar(100),
                        @OVERWRITEOUTPUTIDSET bit,
                        @CONSTITUENTINACTIVITYREASONCODEID uniqueidentifier,
                        @CONSTITUENTINACTIVITYDETAILS nvarchar(300)
                    )
                    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
                                SOURCETABLEID = @SOURCETABLEID,
                                FILTERSELECTIONID = @FILTERSELECTIONID,
                                MINSIMILARITY = @MINSIMILARITY,
                                DELETEDUPES = @DELETEDUPES,
                                CREATEOUTPUTIDSET = @CREATEOUTPUTIDSET,
                                OUTPUTIDSETNAME = @OUTPUTIDSETNAME,
                                OVERWRITEOUTPUTIDSET = @OVERWRITEOUTPUTIDSET,
                                CONSTITUENTINACTIVITYREASONCODEID = @CONSTITUENTINACTIVITYREASONCODEID,
                                CONSTITUENTINACTIVITYDETAILS = @CONSTITUENTINACTIVITYDETAILS,
                                CHANGEDBYID = @CHANGEAGENTID,
                                DATECHANGED = @CURRENTDATE
                            where
                                ID = @ID;
                        end try
                        begin catch
                            exec dbo.USP_RAISE_ERROR;
                            return 1;
                        end catch

                        return 0;