WHERE T0.DOCENTRY = @list_of_cols_val_tab_del AND T2.[GSTRegnNo] IS NULL OR T2.[GSTRegnNo]= '')

begin

set @error = 101

set @error_message = 'PLEASE UPDATE GST REG NO IN VENDOR MASTER DATA'

end

End

---------------------------------

This is working Ok but the problem is there are many vendors who does not comes under GST criteria and their GST Regn No can not be entered. So I have made an UDF in the BP Master data named Liable for Tax with valid values as 'Yes' and 'No'. But I dont know how to make queries which fulfills both the criteria.

In short if the value in the UDF is Yes then PO should not be added before the GST Regn No is filled. And if the value in UDF is No then PO should be added without adding any GST Regn NO.