Solved

using $Filter with a numeric value field

  • 9 December 2022
  • 4 replies
  • 183 views

Hi,

 

I’m tryiung to do a GET request from:

acumatica/entity/Default/18.200.001/invoice?$filter=CreatedDateTime gt datetimeoffset'2021-09-10T00:00:00.000-00:00' and Status eq 'Open'

 

That returns the open invoices starting one date.

Now I want to add a Balance component but I cannot make it works, I tried: 

CreatedDateTime gt datetimeoffset'2021-09-10T00:00:00.000-00:00' and balance gt 0

ALSO

CreatedDateTime gt datetimeoffset'2021-09-10T00:00:00.000-00:00' and balance=0

 

With no success, I’m pretty sure it is a simple thing, but I cannot find it

 

How can I do it?

 

Thanks,

Ignacio

icon

Best answer by Samuel Olivier Lavigueur 9 December 2022, 23:46

View original

4 replies

Userlevel 3
Badge +2

Not sure the issue that you are facing here.

Is it not working because of an error or because nothing is being returned?

 

If it is because of an error like the following :

"A binary operator with incompatible types was detected. Found operand types 'Edm.Decimal' and 'Edm.Double' for operator kind 'GreaterThan'.",

or

"Type conversions not supported",

 

Adding the letter ‘m’ to your integer can resolve the issue :

CreatedDateTime gt datetimeoffset'2021-09-10T00:00:00.000-00:00' and balance gt 0m

Thanks for that answer, all I was missing was the m at the end

Hi,

 

Now I have another question, how to include the details, I tried

/entity/Default/18.200.001/invoice? $expand=Details&$filter=CreatedDateTime gt datetimeoffset'2021-01-10T00:00:00.000-00:00' and balance gt 0.0m

 

but I got no change from when I call it without it

 

Thanks again,

Ignacio

Userlevel 7
Badge +11

Hi @ignacio85 

The issue with the Endpoint URL. Extra space was added between the? and $. Please remove the space and try.

entity/Default/20.200.001/invoice?$expand=Details&$filter=CreatedDateTime gt datetimeoffset'2022-01-10T00:00:00.000-00:00' and balance gt 0.0m
 

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