Hi Anirudh Gupta
Try This TNSP
If (@object_type = '22') and (@transaction_type in ('D' , 'U'))
BEGIN
IF EXISTS ( SELECT Itemcode FROM opor t1
INNER JOIN por1 t2 ON t1.DOCENTRY = t2.DocEntry
WHERE t1.DocEntry =@list_of_cols_val_tab_del
)
BEGIN
SELECT @Error = 22
SELECT @error_message = 'Delete Not Possible'
END
END
Regards
Venki