1
votes

I have used this blog post to attempt to setup an endpoint to retrieve generic inquiry data but I appear to be missing something. Our default endpoint is on Contract 1 so I did not extend that endpoint, is that necessary to get this to work? We have another custom endpoint and I setup the generic inquiry as laid out in the blog post but when I make the PUT request via postman with the "$expand=Result" parameter I receive a 500 and exception error "The given key was not present in the dictionary".

I am not super familiar with Acumatica or generic inquiries but from that blog post and other resources my understanding is that in order to retrieve the results of a generic inquiry it cannot be setup as a top-level resource or else you will only receive 1 record. I am trying to retrieve the entire list of records.

Any help will be greatly appreciated!

Here is a screenshot of the setup: Screenshot of Endpoint Setup

2
The 500 error seems to suggest that the entity you're trying to retrieve doesn't exist. If you don't have the GI set up as a top-level entity, what IS the top-level entity? Have you tried using the GI object as the top-level entity? - Deetz
I guess I did not phrase that correctly. I do have the GI as the top-level entity but no fields for it. Below that I have a Detail object that contains the 3 fields from the GI that I want to return and they are mapped to Result. - beachbum
I don't know that I can help much in that case, except to wonder if there is a reason you must use a GI? You can select multiple records based upon a condition and even specify what fields to return without using a GI. More info here: help-2020r2.acumatica.com/… - Deetz
I don't know that I have to use GI but I tried to use an entity as available in the system by adding it to my custom endpoint but I receive a response of null. I would copy the Default endpoint but in our system it is on Contract 1. Thanks for your help! - beachbum
Could you copy the default endpoint and just confirm you did the custom one correctly? - Deetz

2 Answers

2
votes

The error message you describe usually indicates something missing with respect to the endpoint. Per the blog post - did you define the endpoint like this (which is the correct structure)?: Example Endpoint for GI

If you are not sure, please post a picture of what you created in your custom endpoint, and I will see if I can assist from there.

0
votes

I've actually been working on the same thing, referencing the same article.

I am able to get it to work as described. One question, are you specifying the $filter parameter? I only get this error when I try to use a filter. I am able to call the new endpoint and get back full results.

I found your post searching for a way to use a filter or I trying to find out if there is anyway to pass parameters to the GI from the rest call.