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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Active Discussion

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

  • Rawish Kumar Profile Picture
    13,758 on at

    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 

  • Bipin D365 Profile Picture
    28,995 Moderator on at

    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

  • Community Member Profile Picture
    on at

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 119 Super User 2026 Season 2

#2
Syed Aqib Raza Profile Picture

Syed Aqib Raza 72

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans