Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Odata call to update DirPartyRelationship

(0) ShareShare
ReportReport
Posted on by 40

I am trying to update (PATCH) a party relationship via  the DirPartyRelationShip entity.

I have tried to PATCH on this:

{{resource}}/data/PartyRelationships(RelationshipType='BeneficiaryTrust',ParentPartyId='000000603',ChildPartyId='000000403',LegalEntityDataArea='',ValidTo='2154-12-31T23:59:59Z', ValidFrom = '2023-02-09T07:06:13Z')

but I am getting a 404:

{
    "Message": "No HTTP resource was found that matches the request URI 'https://xxxx.dynamics.com/data/PartyRelationships(RelationshipType='BeneficiaryTrust',ParentPartyId='000000603',ChildPartyId='000000403',LegalEntityDataArea='',ValidTo='2154-12-31T23:59:59Z', ValidFrom = '2023-02-09T07:06:13Z')'. No route data was found for this request."
}

Any idea what I am doing wrong in my request

A get on this endpoint will return data like:

{
    "@odata.context": "https://xxx.dynamics.com/data/$metadata#PartyRelationships",
    "value": [
        {
            "@odata.etag": "W/\"JzEsNTYzNzE1MTMyNabcLDU2MabcNDQ2MDAn\"",
            "RelationshipType": "BeneficiaryTrust",
            "ParentPartyId": "000000603",
            "ChildPartyId": "000000403",
            "LegalEntityDataArea": "",
            "ValidTo": "2154-12-31T23:59:59Z",
            "ValidFrom": "2023-02-09T07:06:13Z",
            "CustomField1": "test"
        }
    ]
}

  • Zisis Profile Picture
    Zisis 40 on at
    RE: Odata call to update DirPartyRelationship

    You are a hero, well spotted!

    But now I am facing another issue.. :/

    Any idea why it doesnt seem to update the ValidTo datetime?

    It responds back 204 - no content as expected but the 'ValidTo' field doesn't change value:

    Patch request body:

    {
        "ValidTo": "2025-12-31T23:59:59Z"
    }

  • Verified answer
    AnithaEswaran Profile Picture
    AnithaEswaran 2,032 on at
    RE: Odata call to update DirPartyRelationship

    Hi,

    I tried in my system for the same entity.

    Try this : 

    /data/PartyRelationships(RelationshipType='ContactPerson',ParentPartyId='000004348',ChildPartyId='000005276',ValidTo=2154-12-31T23:59:59Z, ValidFrom = 2015-10-22T13:16:37Z,LegalEntityDataArea=' ')

    Remove speech marks from ValidTo & ValidFrom fields

    pastedimage1675959140558v1.png

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans