Error creating Incidents "CRM do not support direct update of Entity Reference properties, Use Navigation properties instead"

Victor Rodriguez 5 Reputation points
2023-03-06T22:09:32.9733333+00:00

We are trying to use CRM api to create incident. we have data source but we are not able to process the request due to below errors. 

When we submit create a new incident using postman we get a response with the error "You should specify a parent contact or account"

pastedimage1678131611117v2.png-1872x936

If we add the parameter CustomerId (name as "_customerid_value" in the list of incidents if you request this same method with a get protocol) , we get the error "CRM do not support direct update of Entity Reference properties, Use Navigation properties instead."

pastedimage1678138394763v4.png-1840x920

After some research an article with a similar mistake shows an idea of how to solve the problem

pastedimage1678138629459v5.png-1392x478

We try to set the CustomerId using the odata.bind but there is no "Customer" method to pass the id to get an object, we are not sure either if "_customerid_value" is the correct property to set the customer

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,584 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Itamar Brina 0 Reputation points
    2024-12-25T09:20:36.09+00:00

    Well, if I understand it correctly you are trying to give reference for entity B while creating entity A, if that the case let's give example and solution, Suppose you have entity named "container" and entity named "inner" and you want to add reference for inner in the container through api call, the field that hold the reference called "inner_ref" well it will look like this in postman body - "inner_ref@odata.bind" : "/inners(00000-0000-0000-0000-000000000001)" something worth to take into consideration is that when you trying to get record from inner table then the access is made from the table name in plural form - so it becomes "inners" instead of "inner", hope it helps - good luck!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.