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

  • Community Member Profile Picture
    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 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
    28,981 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
    13,758 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans