
[dbo].[XLedgerRequestTransactionHoldChange]
create procedure [dbo].[XLedgerRequestTransactionHoldChange]
@xLedgerTransactionHeaderIds IntList readonly,
@onHold bit
as
begin
set nocount on
declare @holdStatusId int =
( select Id = XLedgerTransactionHoldStatus.XLedgerTransactionHoldStatusId
from XLedgerTransactionHoldStatus
where [Description] = case when @onHold = 1 then 'NotYetOnHold' else 'NotYetOffHold' end )
update XLedgerTransactionHeader set
XLedgerTransactionHoldStatusFid = @holdStatusId
from @xLedgerTransactionHeaderIds Ids
where XLedgerTransactionHeader.XLedgerTransactionHeaderId = Ids.Item
declare @rowCount int = 0
insert into XLedgerTransactionHoldSubmission(
XLedgerTransactionHeaderFID,
XLedgerSubledgerTransactionDbId,
OnHold
)
select
Ids.Item,
XLedgerTransactionHeader.SubledgerTransactionXLedgerDbId,
@onHold
from @xLedgerTransactionHeaderIds Ids
inner join XLedgerTransactionHeader on Ids.Item = XLedgerTransactionHeader.XLedgerTransactionHeaderId
set @rowCount = @@rowcount
if @rowCount > 0
begin
insert into MssWebEvent( MssWebEventTypeFid )
select MssWebEventType.MssWebEventTypeId
from MssWebEventType where MssWebEventType.EventTypeName = 'XLedgerTransactionHoldChangeRequested'
end
end
GO
GRANT EXECUTE ON [dbo].[XLedgerRequestTransactionHoldChange] TO [MssExec]
GO