USP_DATAFORMTEMPLATE_EDIT_BATCHMODELINGANDPROPENSITY

The save procedure used by the edit dataform template "Modeling and Propensity Batch Row 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.
@SEQUENCE int IN Sequence
@IMPORTID nvarchar(36) IN Import ID
@ANNUALGIFTLIKELIHOOD smallint IN Annual gift likelihood
@ANNUITYLIKELIHOOD smallint IN Annuity likelihood
@BEQUESTLIKELIHOOD smallint IN Bequest likelihood
@CRTLIKELIHOOD smallint IN CRT likelihood
@MAJORGIVINGLIKELIHOOD smallint IN Major gift likelihood
@PLANNEDGIFTLIKELIHOOD smallint IN Planned gift likelihood

Definition

Copy

                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_BATCHMODELINGANDPROPENSITY(
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @SEQUENCE int,
                        @IMPORTID nvarchar(36),
                        @ANNUALGIFTLIKELIHOOD smallint,
                        @ANNUITYLIKELIHOOD smallint,
                        @BEQUESTLIKELIHOOD smallint,
                        @CRTLIKELIHOOD smallint,
                        @MAJORGIVINGLIKELIHOOD smallint,
                        @PLANNEDGIFTLIKELIHOOD smallint
                    ) as

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

                        begin try
                            update dbo.BATCHMODELINGANDPROPENSITY set
                                SEQUENCE = @SEQUENCE,
                                IMPORTID = @IMPORTID,
                                ANNUALGIFTLIKELIHOOD = @ANNUALGIFTLIKELIHOOD,
                                ANNUITYLIKELIHOOD = @ANNUITYLIKELIHOOD,
                                BEQUESTLIKELIHOOD = @BEQUESTLIKELIHOOD,
                                CRTLIKELIHOOD = @CRTLIKELIHOOD,
                                MAJORGIVINGLIKELIHOOD = @MAJORGIVINGLIKELIHOOD,
                                PLANNEDGIFTLIKELIHOOD = @PLANNEDGIFTLIKELIHOOD,
                                DATECHANGED = getdate(),
                                CHANGEDBYID = @CHANGEAGENTID
                            where 
                                ID = @ID;
                        end try
                        begin catch
                            exec dbo.USP_RAISE_ERROR;
                            return 1;
                        end catch

                        return 0;