Solved

Filter, select, and expand

  • 21 July 2023
  • 7 replies
  • 362 views

Userlevel 2
Badge

Hi all, 

We’re trying to create integrations and during the testing, I’m running into some issues with the api parameters. Does Acumatica support the following? 

 

entity/default/22.200.001/vendor?$filter=VendorID eq '501446'&?$expand=MainContact,MainContact/Address

I find that when I try to use filter or select when expanding that I get unexpected or limited results. Is this a limitation of the api or is my syntax not correct?

I’m trying to get an efficient query that gets a couple of fields on the vendor entity and a few off the expanded entities. I have been able to remove filter, select, and expand and get the entire data set, but I don’t want that waste in the automation. 

 

Thanks in advance!

icon

Best answer by Leonardo Justiniano 21 July 2023, 23:54

View original

7 replies

Userlevel 6
Badge +4

Hi @jamest 

 

I tested your call and works fine. It is limited by the mapping you have in the endpoint.

 

As you can see with the Main Contact, not all the fields are mapped:

 

If you want more fields you can extend the endpoint to map additional fields you need.

Userlevel 2
Badge

Thanks, @Leonardo Justiniano 

I think I get it and it looks like my fields are mapped. The query works fine with just the expand, but when a filter or select is added, it doesn’t work completely. 

Am I missing something?

First is just the expand. Second is the same query with the filter. 

 

Userlevel 6
Badge +4

Hi @jamest 

 

In my test I added a “filter” to retrieve 1 record and works fine.

 

and

 

The only difference is my expand clause is before the filter. I know it should not matter, but maybe in this case it does.

Userlevel 2
Badge

Interesting, I tried that before and just verified it again mirroring your structure. I still get back all the records in the entity.

Also, thank you for your time answering this thread. I appreciate it!

 

All records
​​​​​​
Here is the valid record

 

Userlevel 6
Badge +4

@jamest 

 

Insignificant but you have an extra ? in the URL

 

 

Userlevel 2
Badge

@Leonardo Justiniano That was it! Much appreciated, I would think the query fail if there was an out of place parament indicator, but I guess not. Thanks Leo!

Userlevel 6
Badge +4

Happy to help!

Remember to set it as your answer 😄

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