Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

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

$
0
0

Hello,

 

I have the following SP to prevent user to create invoice 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 Methods 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. However the Payment Methods icon is still enabled. Then if he tries creating the Invoice (without payment), the Invoice will be created but it will show No matching records found 'Invoice Payment'(ORCT)(ODBC-2028) [Message 131-183] error.


Now the invoice is created without any payment, but the create button label still says Create, 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.



Viewing all articles
Browse latest Browse all 3363

Trending Articles



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