Skip to Content
Former Member
Nov 13, 2015 at 10:00 PM

Why am I getting (ODBC-2028) Message 131-183 ERROR in Transaction Notification SP



I have the following SP to prevent user to create incoming payments for any customer which CardCode starts with CL.

If @object_type in ('13')  and @transaction_type in ('A','U')
   If (
  select count(*)
  from OINV a inner join RCT2 b on a.DocEntry = b.DocEntry
  inner join ORCT c on b.DocNum = c.DocNum
  where (a.DocEntry = @list_of_cols_val_tab_del) and c.Series = 18
  and a.CardCode like 'CL%'
   ) > 0
        Set @error=103
    Set @error_message= 'SP: You cannot realize this operation for CL customer.'

If user creates a invoice and add a payment through Payment Means form, the SP will throw the error when trying to create the invoice, neither the invoice document nor payment will be created in the database, that is ok.

Once the error appears the user notes he cannot create payments, so he will want to delete the payment in the form, he will delete the Total for the payment and press OK. Then if he tries creating the Invoice (without payment), the Invoice will be created but it will show No matching records found 'Incoming Payment' (ORCT) (ODBC-2028) [Message 131-183] error.

Now the invoice is created without any payment, but the create button label still says Add, just like It had not been created which results confusing for the users.

Why am I getting the mentioned error?

Is there a way to conditionally prevent users to add payment to invoice?

If I change the Object type to 24 (Payments Objects) in the SP, the results will be the same.

Thanks for considering my question.