cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction Notification lines

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kiran,

Try this updated code:

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

begin

IF Exist AcctCode

from IGE1

where '500025' IN (select DISTINCT AcctCode from ige1 where docentry = @list_of_cols_val_tab_del)

begin

set @error = 1

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

end

End

Thanks,

Gordon