Hi
U have to amend it like this :
if @object_type = '30' and @transaction_type IN ('A', 'U')
BEGIN
IF Exists (Select T0.TransID from dbo.OJDT T0
WHERE T0.TransId =@list_of_cols_val_tab_del and t0. U_MD_APPROVAL <> 'Approved' and Transtype='30')
select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'
---------------------------------------------------------
if @object_type = '30' and @transaction_type IN ('A', 'U')
BEGIN
Set @Transtype =(Select Transtype from OJDT WHERE T0.TransId =@list_of_cols_val_tab_del )
declare @Transtype as int
If Transtype='30'
Begin
IF Exists (Select T0.TransID from dbo.OJDT T0
WHERE T0.TransId =@list_of_cols_val_tab_del and t0. U_MD_APPROVAL <> 'Approved' )
select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'
End
END
Thanks
TAruna