on 06-02-2010 8:46 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.