Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Filter by SystemChangedAt on BC OData API

Posted on by 5

Hello guys,

I'm creating an integration between BC and my system, and I need to sync Jobs as Job Tasks, using OData it is possible to filter using the $filter query string.

So far so good, but I'd like to filter by most recent changes, and most of the entities have SystemCreatedAt and SystemModifiedAt fields, but I can't do 

GET https://api.businesscentral.dynamics.com/v2.0/{{tenantID}}/{{env}}/ODataV4/Job_Task_Lines?$skip=999&$top=10&$filter=SystemModifiedAt gt '2022-01-01'


I got an error
{
  "error": {
    "code": "BadRequest",
    "message": "Could not find a property named 'SystemModifiedAt' on type 'NAV.Job_Task_Lines'.  CorrelationId:  56d3ae6a-0877-411a-b2ef-68a0f0b7cd27."
  }
}

Is there another way to filter by changes given a date?

Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 68,536 Super User 2024 Season 2 on at
    RE: Filter by SystemChangedAt on BC OData API

    Hi, There is nothing wrong with your Get statement and filter.
    It's just that you didn't add the SystemCreatedAt and SystemModifiedAt fields to the page. They are in the table but not guaranteed to be in the Webservice.

    I did a test with a standard Web Service.

    First of all this field needs to exist on the page.

    pastedimage1668648243170v1.png

    Then add filter.

    api.businesscentral.dynamics.com/.../Sales_Lines_Excel gt 2022-10-03

    pastedimage1668648314574v2.png

    Hope this helps.
    Thanks.

    ZHU

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,215 Moderator on at
    RE: Filter by SystemChangedAt on BC OData API

    hi

    you should create similar fields with the same logic

    DANiele

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans