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.

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

If you answer, please close this thread by marking correct answer.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Md Zak,

Try dis..

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 and T0 .DocEntry = @list_of_cols_val_tab_del)

  Begin

  set @error = N'001'

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

  End

END

Hope Helpfull

Regards::::

Atul Chakraborty