Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Modify a record through ODATAV4

(0) ShareShare
ReportReport
Posted on by 3,957

Hi All,

I have a record created in Business Central and is pulled to CDS Correctly. After modifyingthe record in CDS, I want to update my record in Business Central.

The issue is that the table consists 3 key fields Time Sheet No., Time Sheet Line No. and Date.

When I call the url through GET method, I'm precisely getting that single record.

GET.png

When I try to modify the record using PATCH, I'm getting the following error

'Could not validate the client concurrency token required by the service. Please provide a valid token in the client request'

PATCH.png

I have followed this url

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/use-odata-to-modify-data

I have also passed the Etag as a part of If-Match but that just gives the same result.

Kindly advise!

  • Verified answer
    Olister Rumao Profile Picture
    3,957 on at
    RE: Modify a record through ODATAV4

    Aaahh....

    You are right.. I made a silly mistake...

    Yes I have confirmed that things are working as desired.

    FYI If-Match = * also works perfectly

    Thanks a lot man.. I guess I needed a second pair of eyes :)

  • Verified answer
    gert-jan.terschure Profile Picture
    200 on at
    RE: Modify a record through ODATAV4

    From the screenshots I can see you're adding the If-Match and Content-Type to the tab "Params", these will be added to the url. This is intended behavior as the params could contain items such as "$filter" and "$select".

    Please place them in tab "Headers" (3rd tab from the left), that is where the headers that are being sent as part of the request are added.

  • Suggested answer
    Olister Rumao Profile Picture
    3,957 on at
    RE: Modify a record through ODATAV4

    Hi Gert,

    Thank you I appreciate your help, but I'm getting the same error.

    I do not understand why If-Match becomes a part of the URL
    PUT.png

    Also, I'm showing the body of the call

    PUIT-BODY.png

    I hope this makes it clear.
    Let me know if you need any more details or we can have a call to understand it further.

  • Verified answer
    gert-jan.terschure Profile Picture
    200 on at
    RE: Modify a record through ODATAV4

    From the screenshots the If-Match seems to be placed in the url. It needs to be placed in the header. Please note that the @odata.etag that's provided by Business Central/NAV is "escaped json", so you'll need to remove the "\" that are placed in front of the double quotes.

    pastedimage1585805687917v1.png

  • Suggested answer
    Olister Rumao Profile Picture
    3,957 on at
    RE: Modify a record through ODATAV4

    Hi,

    Yes I have also tried that but it gives the same result.

  • Verified answer
    gert-jan.terschure Profile Picture
    200 on at
    RE: Modify a record through ODATAV4

    You need to provide the If-Match header in the PUT request. When you get the result you get the "@odata.etag" property, this is the concurrency token.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans