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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

deep insert custom entities 1:n relationship odata api

(0) ShareShare
ReportReport
Posted on by 20

Hi,

I have a problem inserting 1:n relation entity using odata api. I have two entities: submissions, and claims. I want to create submission and multiple claims with one post. I understand it can be done using deep insert, but, it does not work in my case.If I insert submission entity only, it works (if i remove everything from line 7 to 12 it works).

5672.pastedimage1597899222825v2.png

relationship print screen

7356.pastedimage1597899443998v3.png

Thanks,

Max

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,208 on at

    Hi Max,

    It might be caused by fieldname of your child entity(Claim) is not correct:

    The field name is case sensitive, e.g:

    I have a custom entity Country, and the relationship between Country and Contact is 1:N,

    When creating a Country with multiple contacts, if my data is something like below:

    {
    "new_name": "Clofly Republic",
    "new_new_country_contact_Country": [
            {
                "Firstname": 'Clofly',
                "Lastname": 'Mao'
            }
        ]
    }

    As you can see, fields of Contact entity are "Firstname" and "Lastname", then I encountered same error if I keep the wrong name.

    After changing them to firstname and lastname, it works.

    Therefore, I suggest you could change dsl_DocumentNumber, dsl_ServiceType to dsl_documentnumber and dsl_servicetype to test again.

    Regards,

    Clofly

  • Roma Gupta Profile Picture
    725 on at

    Hi MaxRy

    Is the document number being used in your screenshot unique? Does this work for the first time including lines 7 to 12?

    Regards

    Roma

  • MaxRy Profile Picture
    20 on at

    That was it. Naming of the fields. It works now, thank you very much for the tip.

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

News and Announcements

[Smoke test 2510.1]

Quick Links

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans