USP_RECORDOPERATION_WEALTHUPDATES_RESEARCHGROUP_DISABLE
Executes the "WealthPoint Updates Research Group: Disable" 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_WEALTHUPDATES_RESEARCHGROUP_DISABLE (
@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()
begin try
insert into dbo.DISABLEDWEALTHUPDATES
(
[ID],
[ADDEDBYID],
[CHANGEDBYID],
[DATEADDED],
[DATECHANGED]
)
select
rgm.CONSTITUENTID,
@CHANGEAGENTID,
@CHANGEAGENTID,
@CURRENTDATE,
@CURRENTDATE
from
RESEARCHGROUPMEMBER rgm
left join DISABLEDWEALTHUPDATES dwu
on rgm.CONSTITUENTID = dwu.ID
where rgm.RESEARCHGROUPID = @ID and dwu.ID is null
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;
end