Skip to Content
0
May 03, 2018 at 05:35 AM

Block sales quotation without Oppertunity

81 Views Last edit May 08, 2018 at 12:22 PM 2 rev

Hi,

My requirement is,

All the sales quotation has to be raise through opportunity and i want to block the direct sales quotation creation. I'm trying this below SP and it's working fine, but it's blocking sales quotation which is create through opportunity also.

IF @transaction_type in ('A') AND (@OBJECT_TYPE='23')

BEGIN

If exists (Select T2.docentry from OOPR T0 INNER JOIN OPR1 T1 ON T1.OpprId = T0.OpprId and T1.ObjType='23'

left join OQUT T2 on t2.DocEntry <> T1.[DocID]

left JOIN QUT1 T3 ON T2.DocEntry = T3.DocEntry

where T2.DocEntry = @list_of_cols_val_tab_del )

Begin

SET @error = 10

SET @error_message = 'Sales quotation not allowed without sales opportunity'

End

End