Skip to main content
Solved

Extract data from general inquiry from via api

  • April 18, 2024
  • 3 replies
  • 245 views

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

Best answer by Alecia

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/

3 replies

  • Author
  • Jr Varsity I
  • Answer
  • April 18, 2024

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/


Forum|alt.badge.img+3

@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


  • Author
  • Jr Varsity I
  • April 18, 2024

@ruchikasharma23 thank you for the guidance and suggestion. 

Will have a look at OData for our use case. 

Thank you!