USP_ACCOUNTINGELEMENTSECURITYGROUPELEMENT_DELETE

Executes the "Accounting Element Security Group Element: Delete" record operation.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN Input parameter indicating the ID of the record being deleted.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the delete.

Definition

Copy


CREATE procedure dbo.USP_ACCOUNTINGELEMENTSECURITYGROUPELEMENT_DELETE
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier
)
as begin
  set nocount on;

  if (select count(1
    from dbo.ACCOUNTINGELEMENTSECURITYGROUPELEMENT
    where ACCOUNTINGELEMENTSECURITYGROUPID = (select ACCOUNTINGELEMENTSECURITYGROUPID from dbo.ACCOUNTINGELEMENTSECURITYGROUPELEMENT where ID = @ID)) = 1
  begin
    raiserror('ERR_ACCOUNTINGELEMENTSECURITYGROUP_ELEMENTREQUIRED', 13, 1)
    return 1
  end

    exec USP_ACCOUNTINGELEMENTSECURITYGROUPELEMENT_DELETEBYID_WITHCHANGEAGENTID @ID, @CHANGEAGENTID
    return 0;

end