Skip to main content

Scenario:

We want to create returns via REST APIs. We have published a customization package for this. Technically, this is how the customization package works:

  1. Creates a blank RC order
  2. Trigger SalesOrderAddInvoice action to add products from the invoices
  3. Update RC with relevant quantities

The above process works for the first RC.

Any further RC creation from the same invoice throws the below error:

"The return quantity exceeds the quantity available for return for the related invoice line <INVOICE_NBR>. Decrease the quantity in the current line, 
or in the corresponding line of another return document or documents <RETURN_NBR> that exist for the invoice line."

 

This is the similar error we usually see on Acumatica UI when adding the same inventory from an invoice.  However, we can create the RC from the UI by modifying the quantity.

 

Question:

Is there anyway to fix this issue?

 

We are on Acumatica 2022 R1.

 


Regards

The actions in which you need to select specific lines from a document do not really work well via REST API. Usually we need to have specific code to handle such situations. 

 

That specific case is not covered in the 22r1 version of Acumatica. However, it is covered in 2022r2 version. 

 

Please check dev release notes (page 22):

http://acumatica-builds.s3.amazonaws.com/builds/preview/22.2/ReleaseNotes/AcumaticaERP_2022R2_Beta_ReleaseNotes_for_Developers.pdf


Thank you, @Dmitrii Naumov

Could you please clarify what specific code you’re referring to? 

 

It’s a crucial feature of our application. Isn’t there any hack or quick fixes to this solution?

We can share the customization code we wrote for this.


@voyantcs I’d say the easiest way to implement it is to create a screen with needed parameters and one action and implement all needed logic there. Then you map that screen to an endpoint and use it via API. 

 


Reply