Skip to Content
0
Feb 06, 2014 at 03:37 PM

Failed validation with SBO_SP_TransactionNotification

20 Views

Hi.

I'm trying to see if there is a document type 18 PCH, when you add a new one, but does not work to add validation to test the update, it works. Can anyone help me where I am going wrong.

Code:

IF @object_type = '18' AND @transaction_type = 'A'

BEGIN

DECLARE @numeroDoc int

DECLARE @CodPn nvarchar(50)

DECLARE @Serial int

SELECT @numeroDoc = CONVERT(int,@list_of_cols_val_tab_del)

SELECT @CodPn = OPCH.CardCode, @Serial = OPCH.Serial FROM OPCH WHERE OPCH.DocEntry = @numeroDoc

SELECT @COUNT_PCH = COUNT(1) FROM OPCH WHERE serial = @Serial and cardcode = @CodPn

IF @COUNT_PCH > 0

BEGIN

SELECT @error = 1,

@error_message = 'FAILED'

END

END