D365 F&O - Cannot post addresses with OData

20 Views Asked by At

I'm required to create the addresses of vendors and customers through an Odata integration. Target system is Dynamics 365 - Finance and Operations. The entity I'm required to use is "PartyLocationPostalAddressesSalesTaxGroupV2".

The issue is that I'm sometimes not allowed to create an address.

I'm posting this payload

{
    "PartyNumber": "1234",
    "LocationId": "1234_Business",
    "Roles": "Business",
    "IsPrimary": "Yes",
    "Description": "Description here",
    "Street": "Street 1",
    "City": "City 1",
    "State": "",
    "ZipCode": "",
    "County": "",
    "CountryRegionISOCode": "DK",
}

I'm also required to control the LocationId since the data is coming from another source system.

I'm getting this error:

{
    "@odata.context": "<dynamicsUrl>/data/$metadata#Edm.String",
    "value": "Write returned RecId 0 for table row of type 'DirPartyLocationPostalAddressSalesTaxGroupV2Entity'. Infolog: .\r\n"
}

What could be the cause of this?

0

There are 0 best solutions below