Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8937

Re: I need a TN validation for avoiding duplicated Sales Opportunities

$
0
0

Hi,

 

Try this:

 

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

BEGIN

IF  exists (SELECT T0.[OpprId] FROM OOPR T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode WHERE T1.[OprCount] >1  and
t0.opprid =  @list_of_cols_val_tab_del )

Begin

SET @error = 123

SET @error_message = 'There are open Oppor for this customer'

End

End

 

Concept is:

 

Only open opportunity will appear in OCRD table. The above SPTN will block if count is more than one.

 

Thanks & Regards,

Nagarajan


Viewing all articles
Browse latest Browse all 8937

Trending Articles