Solved

Extract data from general inquiry from via api

  • 18 April 2024
  • 3 replies
  • 36 views

Userlevel 1

Good day,

 

Can we kindly request some assistance regarding extracting data from a general enquiry form via an api call.

 

We’re trying to export a large list of data (screenshot 1) containing product stock details. We’ve created a general inquiry form and extended an api endpoint.

 

Upon trying to query this new endpoint we are receiving an error: "Optimization cannot be performed.View Results has BQL delegate (screenshot 2)

 

We’ve also had a look at perhaps creating a custom export action endpoint (screenshot 3) for the general enquiry form. Unfortunately we’ve been unsuccessful in attempts to achieve this.

 

Any guidance regarding either approach will be appreciated.

 

Kind regards,

Alecia

icon

Best answer by Alecia 18 April 2024, 13:43

View original

3 replies

Userlevel 1

Posting an answer to the above for anyone needing guidance in the future. 

 

We’ve successfully retrieved the data from the general inquiry form using an extended api endpoint. 

We had to change from ‘get’ to ‘put’ and send an empty json body {}

 

Please see below the resource that helped us. 

https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/

Userlevel 5
Badge +2

@Alecia 
You can also consider OData instead of REST for reading data from GI’s. A few benefits of using OData over REST API are-
1. In OData, you can use filtering options like top and skip. However, it is not possible in REST since the fields are mapped on Detail level.
2. OData is easier to maintain and has better performance.

https://help.acumatica.com/(W(21))/Help?ScreenId=ShowWiki&pageid=5d97a93d-45e0-466e-ba5e-77e1ccf96643

Userlevel 1

@ruchikasharma23 thank you for the guidance and suggestion. 

Will have a look at OData for our use case. 

Thank you!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved