USP_RECORDOPERATION_WPBUSINESSOWNERSHIP_STATUS_UNCONFIRM

Executes the "WealthPoint Business Ownership: Unconfirm" record operation.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN Input parameter indicating the ID of the record being updated.
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the update.

Definition

Copy


                    create procedure dbo.USP_RECORDOPERATION_WPBUSINESSOWNERSHIP_STATUS_UNCONFIRM (
                        @ID uniqueidentifier,
                        @CURRENTAPPUSERID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null
                    ) as begin
                        if @CHANGEAGENTID is null  
                            exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

                        declare @CURRENTDATE datetime
                        set @CURRENTDATE = getdate()

                        update dbo.WPBUSINESSOWNERSHIP set 
                            CONFIRMED = 0,
                            DATECONFIRMED = null,
                            CONFIRMEDBYAPPUSERID = null,
                            REJECTED = 0,
                            DATEREJECTED = null,
                            REJECTEDBYAPPUSERID = null,
                            DATECHANGED = @CURRENTDATE,
                            CHANGEDBYID = @CHANGEAGENTID
                        where
                            ID = @ID

                        declare @WEALTHID uniqueidentifier;
                        select @WEALTHID=WEALTHID from dbo.WPBUSINESSOWNERSHIP where ID=@ID;

                        exec dbo.USP_WEALTHPOINT_UPDATEWEALTHSUMMARY_BUSINESSOWNERSHIP @WEALTHID, @CHANGEAGENTID;
                        exec dbo.USP_WEALTHCAPACITY_UPDATE @WEALTHID, @CHANGEAGENTID;

                        return 0;
                    end