Solved

Filter by LastModified with another datetime field

  • 4 January 2024
  • 3 replies
  • 88 views

Userlevel 4
Badge

I have a datetime field in Stock Item, this is the last time that I have exported the Stock Item Data to an external system.

Is there a way that I can filter StockItem by comparing LastModified with the Exported date?

Something like $filter=LastModified ge Exported.

 

There are many examples using datetimeoffset buy in this case, the date to compare is in the stock item.

 

icon

Best answer by jinin 8 January 2024, 14:30

View original

3 replies

Userlevel 7
Badge +11

Hi @anahizentella94 ,

As of my knowledge, Acumatica's REST API may not directly support comparing two fields in the $filter condition. In RESTful APIs, the standard OData query syntax is often used for filtering, and the OData specification primarily supports comparisons between a field and a constant value.If comparing two fields directly in a filter expression is not supported.

 

 

Userlevel 4
Badge

Thanks for the update, I'll try another approach 

Userlevel 7
Badge +5

One thing that you can do is to create a GI and then expose that GI to the OData interface. The GI can handle that type of filtering requirements and the external system doesn’t need to worry about that.

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