Skip to main content
Solved

Filter by LastModified with another datetime field

  • January 4, 2024
  • 3 replies
  • 243 views

anahizentella94
Jr Varsity III
Forum|alt.badge.img

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.

 

Best answer by jinin

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.

 

 

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • January 8, 2024

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.

 

 


anahizentella94
Jr Varsity III
Forum|alt.badge.img

Thanks for the update, I'll try another approach 


Forum|alt.badge.img+7
  • Captain II
  • January 8, 2024

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.