Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Create / Update record in Entity A via OData then using newly create record in Entity A' to create another record in Entity B.

(0) ShareShare
ReportReport
Posted on by 5

Hi , I have some question regarding create / update CRM data via ODATA .
i have 3 entities
Incident, Document Management and Annotation
Each Annotation will be linked to Document Management
while Document Management is tied to Incident
There is not "direct connection" in between Incident and Annotation
so in order for me to create a new annotation record, i need to create a new Document Management / or Update existing Document Management so the  new Document Management will be tied to incident
so just want to know,, is it possible in Incidentform,
i call the ODATA using Javascrip to create new record / update existing record via Document Management entitle then tit will return the GUID
so i use the GUID to create a new Annotation record based on the newly create / existing Document Management GUID

  • RE: Create / Update record in Entity A via OData then using newly create record in Entity A' to create another record in Entity B.

    Hi Hou,

    You can create new record with related record and associate it to existing entity record by using @odata.bind annotation.

    You can refer following link:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/create-entity-web-api

    you can also use flow to achieve it, which without coding.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: Create / Update record in Entity A via OData then using newly create record in Entity A' to create another record in Entity B.

    Hi,

    The only challenge you will face is async call. As you know most of the browser does not support sync api call. So we will have to use async call.

    Now the problem with async call is it will execute in order which will not known to us.

    For your requirement I would recommend to use Custom Action and call this from Javascript. Now perform Create/Updae record in Custom Action Plugin/Workflow code.

    Other option is Js code is to use promise. Check below article.

    ajitpatra.com/.../

    Please mark my answer verified if i were helpful

  • Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: Create / Update record in Entity A via OData then using newly create record in Entity A' to create another record in Entity B.

    Yes. you can design the script the way you want. on what action you want to perform these, on some field change? form save?

    you just have use docs.microsoft.com/.../createrecord

    this will return you the id of the newly created record which you can again use:

    pastedimage1599676528569v1.png

    if you are looking to do an upsert , follow this : https://community.dynamics.com/crm/b/mylifemicrosoftdynamiccrm/posts/upsert-with-alternate-key 

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans