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

Re: AP Invoice duplicate entry blocking than SQL error

$
0
0

Hi Chetan,

 

Try this simple code.

 

IF @transaction_type in ('U','A') AND @object_type = '18'

Begin

 

 

IF exists(SELECT T0.[DocEntry]

   FROM OPCH T0 

   WHERE T0.DocEntry = @list_of_cols_val_tab_del

   AND T0.NumAtCard in (select OPCH.NumAtCard from OPCH where OPCH.DocEntry = T0.DocEntry and OPCH.CardCode = T0.CardCode))

 

 

BEGIN

 

 

SET @error = 18

SET @error_message = 'Duplicate Vendor Ref Number!'

 

 

END

END

 

Regards,

Alvin


Viewing all articles
Browse latest Browse all 8372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>