Acumatica Web Service Endpoints - URL filter by datetime range

799 views Asked by At

I just wondering if you can assist us with following issue regarding retrieving data via Web Service endpoints filtered by date time range. I created a General Inquiry that retrieves all open orders (SO) and expose it via Web Service Endpoint(6.00.001): enter image description here

And here is the mapping for my GI used in custom endpoint: enter image description here

The issue I am facing now is that when I try to filter by datetime field (DueDate) between a date time range it does not work. I can only make it work if I filter by DueDate greater than or DueDate lower than using datetimeoffset but not between the datetime range.

Do you have any example of URL I can use to filter a Web Service Endpoint by datetime range?.

Thanks,

1

There are 1 answers

1
RuslanDev On

The correct way to map a GI in a Contract-Based Endpoint is as follows:

  • there must always be a top-level entity (GetOrdersToBePicked in the screenshot below) mapped to the Filter object, that will be used to pass parameter values to the GI enter image description here
  • the nested Detail collection (OrdersToBePicked in the screenshot below) mapped to the Result object will be used to obtain the list of orders within the date range specified for our top-level entity enter image description here

To retrieve data from your GI, simply send PUT command with date range defined in request body and expand query parameter, 100% mandatory in this case, to request the list of sales orders satisfying filter conditions:

../entity/ExtendedDefault/6.00.001/GetOrdersToBePicked?$expand=OrdersToBePicked

{
    "DueDateFrom" : { "value": "2017-06-01T00:00:00+00:00" },
    "DueDateTo" : { "value": "2017-08-31T00:00:00+00:00" },
}