Hi,
Try this. Change your user code
IF @transaction_type = 'A' AND @object_type = '13'
BEGIN
IF EXISTS
(SELECT T0.ItemCode FROM [dbo].[INV1] T0 inner join OINV t1 on t1.DocEntry=t0.docentry
WHERE T0.BaseType != 17 and T1.[UserSign] = '1' and T0.DocEntry = @list_of_cols_val_tab_del)
SELECT @Error = 1, @error_message = 'Invoice is not based on Sales Order'
END
END
Thanks & Regards,
Nagarajan