USP_DATAFORMTEMPLATE_RUNTIMESAVE_CLEARMGCLAIMPROCESS

The save procedure used by the edit dataform template "Clear Matching Gift Claims Process Runtime 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.
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@SELECTIONID uniqueidentifier IN Selection
@CREATEOUTPUTSELECTION bit IN Create selection from results
@OVERWRITEOUTPUTSELECTION bit IN Overwrite existing selection
@OUTPUTSELECTIONNAME nvarchar(100) IN Selection name

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_RUNTIMESAVE_CLEARMGCLAIMPROCESS
                    (
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier,
                        @CURRENTAPPUSERID uniqueidentifier,
                        @SELECTIONID uniqueidentifier,
                        @CREATEOUTPUTSELECTION bit,
                        @OVERWRITEOUTPUTSELECTION bit,
                        @OUTPUTSELECTIONNAME nvarchar(100)
                    )    
                    as
                    set nocount on;

          if dbo.UFN_BUSINESSPROCESS_IDSETCANBECREATED(@OUTPUTSELECTIONNAME)= 0
            raiserror('BB_ERR_IDSETCANBECREATED',13,1)

          if ((@OVERWRITEOUTPUTSELECTION = 0) and (dbo.UFN_BUSINESSPROCESS_IDSETEXISTS(@OUTPUTSELECTIONNAME) = 1) and @CREATEOUTPUTSELECTION = 1)
            raiserror('BB_ERR_IDSETEXISTS',13,1)

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

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

                    begin try
                        update dbo.CLEARMATCHINGGIFTCLAIMSPROCESS
                            set 
                                SELECTIONID = @SELECTIONID,
                                CREATEOUTPUTSELECTION = @CREATEOUTPUTSELECTION,
                                OVERWRITEOUTPUTSELECTION = @OVERWRITEOUTPUTSELECTION,
                                OUTPUTSELECTIONNAME = @OUTPUTSELECTIONNAME,
                                CHANGEDBYID = @CHANGEAGENTID,
                                DATECHANGED = @CHANGEDATE
                        where ID = @ID;
                    end try
                    begin catch
                        exec dbo.USP_RAISE_ERROR;
                        return 1;
                    end catch

                    return 0;