Skip to Content
author's profile photo Former Member
Former Member

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

Hello,

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')
Begin
   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
    Begin
        Set @error=103
    Set @error_message= 'SP: You cannot realize this operation for CL customer.'
  End
End




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.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 14, 2015 at 12:22 AM

    OINV a inner join RCT2 b on a.DocEntry = b.DocEntry


    why are you trying to join these two? the DocEntry key should not be on the join relationship.



    Frank

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Frank Wang

      That produces the same relationship I have, I am still facing this issue don't know how to prevent users to create incoming payments from A/R Invoice through Payment Means form. It'd be great if I could just disable Payment Means icon for some users.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.