cancel
Showing results for 
Search instead for 
Did you mean: 

Req:validtion query for sales quotation

Former Member
0 Kudos

Hi,

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')

begin

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=N'001'

select @error_message =N'Freight1 Tax code should be empty.'

end

but didnot get the result.Plz give the solution.

View Entire Topic
kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this:

IF @object_type ='23' and @transaction_type in ('A','U')

begin

IF exists(SELECT T0.docentry  FROM 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 or T1.TaxCode ='')  and T0.DocEntry = @list_of_cols_val_tab_del )

select @error=N'001'

select @error_message =N'Freight1 Tax code should be empty.'

End

End

Please advice your localization.

Thanks & Regards,

Nagarajan