Skip to Content
0
Former Member
Jun 02, 2010 at 07:46 AM

Transaction Notification lines

49 Views

Hi All,

I would like to allow only a select few transactions from using a specific transactions from using a specific GL account.

Declare @CogsAcct as nvarchar(15)

--Goods Issue

If @object_type = '60' and @transaction_type in ('A','U')

begin

Select @CogsAcct = (select top 1 AcctCode from ige1 where docentry = @list_of_cols_val_tab_del order by acctcode)

from IGE1

where docentry = @list_of_cols_val_tab_del

If @CogsAcct = '500025'

begin

set @error = 1

set @error_message = 'Please Change Cost Control Account.'

end

End

The problem with the code is that it only checks the lowest value GL account to compare against, and not all values used in the transaction and this could exist on any line.

How would i use the transaction notification to validate all lines?

Thanks in advance

Kiran