I would like to put validation for sales quotation when Freight1 Tax Code at line level is not empty
My query is:
if @object_type ='23' and @transaction_type in ('A','U')
if exists(SELECT * FROM [dbo].[OQUT] T0 INNER JOIN QUT2 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry
WHERE T1.TaxCode is not null and T0 .DocEntry = @list_of_cols_val_tab_del and
T2 .DocEntry =@list_of_cols_val_tab_del )
select @error_message =N'Freight1 Tax code should be empty.'
but didnot get the result.Plz give the solution.