Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Filter by SystemChangedAt on BC OData API

(1) ShareShare
ReportReport
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?

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,595 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,274 Super User 2024 Season 1 on at
    RE: Filter by SystemChangedAt on BC OData API

    hi

    you should create similar fields with the same logic

    DANiele

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans