USP_TREASURYDEPOSITPROCESS_DELETE

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@CHANGEAGENTID uniqueidentifier IN

Definition

Copy


CREATE procedure dbo.USP_TREASURYDEPOSITPROCESS_DELETE
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier
)
as begin
    --check deletion rules, if any

  begin try

    if exists(select 1 from dbo.BUSINESSPROCESSSTATUS BPS where BPS.BUSINESSPROCESSCATALOGID = '434AC0DD-A3F3-480C-B7DA-204C40205A68' and BPS.BUSINESSPROCESSPARAMETERSETID = @ID and STATUSCODE = 1)
        raiserror('BBERR_PROCESS_RUNNING', 16, 1);

    -- use the system generated delete routine to allow proper recording of the deleting agent

    exec USP_SALESDEPOSITPROCESS_DELETEBYID_WITHCHANGEAGENTID @ID, @CHANGEAGENTID
  end try
  begin catch
        exec dbo.USP_RAISE_ERROR
        return 1
    end catch

    return 0;

end