Skip to Content
0

Transaction Notification

Apr 04, 2017 at 08:24 AM

47

avatar image

IF @OBJECT_TYPE='18' AND @TRANSACTION_TYPE='A'

BEGIN

DECLARE @NumAtCard NVARCHAR(100)

DECLARE @DueToCont NVARCHAR(1)

DECLARE @CardCode NVARCHAR(15)

SET @CardCode = (SELECT CardCode FROM OPCH WHERE DOCENTRY=@LIST_OF_COLS_VAL_TAB_DEL)

SET @NumAtCard = (SELECT ISNULL(NumAtCard, '') FROM OPCH WHERE DOCENTRY=@LIST_OF_COLS_VAL_TAB_DEL)

SET @DueToCont = (SELECT ISNULL(U_DueToCont, N'N') FROM OPCH WHERE DOCENTRY=@LIST_OF_COLS_VAL_TAB_DEL)

IF

(@DueToCont = 'Y')

AND

(@NumAtCard IN (SELECT NumAtCard FROM OPCH WHERE CardCode = @CardCode))

BEGIN

SET @error = 18001

SET @error_message = N'This number card is already exist'

END

END

We have this query that prohibit the entry of an A/P Invoice which have the same NumAtCard with another already existing. There is a UDF Field 'U_DueToCont' which takes the Value 'Yes' in order to do the doublechecking. We are unable to register invoices if filtering for doublecheck not choose 'NO'. How can we change it?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Balaji Selvaraj Apr 04, 2017 at 09:46 AM
0

Hi Alexandros Karadimitropoulos,

You can use Per document setting -->When Duplicated Vendor Reference No. Occurs - Block

Regards:

Balaji.S

Share
10 |10000 characters needed characters left characters exceeded