web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

OData REST API Patch issue

(1) ShareShare
ReportReport
Posted on by 25
Hi,
 
I'm having an issue patching a customers address through Odata in D365 F&O.
 
All of the below is done through Postman. All with system administrator rights.
 
I have created an address for a customer using the PartyLocationPostalAddressesSalesTaxGroupV2 entity with no issue.
 
I get a 200 status code from D365 and everything looks correct.
 
Later, when I try to patch the same address I do as follows:
 
1) Use the sam entity to GET the LocationId, ValidFrom and PartyNumber from the address
2) Make the patch call with the changes in the body. Values are dummy data, but format and datatypes are the same. Values all come from the previous GET call
- URL PATCH: <dynamicsUrl>/data/PartyLocationPostalAddressesSalesTaxGroupV2(PartyNumber='1234',LocationId='000005001',ValidFrom=2024-03-20T12:00:00Z)?cross-company=true
- body: {/Street/: /New Street 1/}
 
And I then get this from D365:
{
    /Message/: /No HTTP resource was found that matches the request URI '<dynamicsUrl>/data/PartyLocationPostalAddressesSalesTaxGroupV2(PartyNumber='1234',LocationId='000005001',ValidFrom=2024-03-20T12:00:00Z)?cross-company=true'. No route data was found for this request./
}
 
What am I doing wrong here?
 
 
 
 
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
    Hi,
     
    I hope this can help you.
     
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    You don't add the Legal Entity to (PartyNumber='1234',LocationId='000005001',ValidFrom=2024-03-20T12:00:00Z), The Legal entity is part of the entity Key. Try it.


     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • TechLogic Profile Picture
    25 on at
    Adding the "LegalEntity" as part of the parameters does only change how the error response is formatted. Now it looks like this:
     
    To my understanding the PartyLocationPostalAddressesSalesTaxGroupV2 is a global entity. I see that there is a LegalEntity field but it is not used. When I got to the "excel workbook designer" inside of D365F&O I do not see the LegalEntity as part of the key.
  • Verified answer
    TechLogic Profile Picture
    25 on at
    The solution has been found
     
    It's required to use "PartyLocationPostalAddressesV2" when patching records in the "PartyLocationPostalAddressesSalesTaxGroupV2" entity.
     
    So with this call:
     
    - URL POST: <dynamicsUrl>/data/PartyLocationPostalAddressesSalesTaxGroupV2
    - body: {<address fields>}
    the address is created.
     
    But when I want to patch the same address I need to do this 
    - URL PATCH: <dynamicsUrl>/data/PartyLocationPostalAddressesV2(PartyNumber='1234',LocationId='000005001',ValidFrom=2024-03-20T12:00:00Z)?cross-company=true
    - body: {/Street/: /New Street 1/}
     
    I haven't seen this documented any where so the solution were found by bright heads brute forcing a lot of different calls.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans