Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Where do I put the Xrm.Page.data.entity.save()?

Posted on by Microsoft Employee

Hi All,

I am new on Dynamics 365. I want to save data that is captured on one page, I have read that I need to use Xrm.Page.data.entity.save(). Now my problem is that I do not know where to put it on on my page. Can someone please point me to the right direction or show mw how to use it?

Kind Regards

Siyabonga Kubeka

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Where do I put the Xrm.Page.data.entity.save()?

    Hi,

    You need to use JavaScript coding to call these APIs. You can choose to trigger by adding an event:

    docs.microsoft.com/.../configure-event-handlers-legacy

    Or choose to add a button and add a JavaScript event to trigger.

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Frank Gong

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: Where do I put the Xrm.Page.data.entity.save()?

    Hi,

    Yes, you can force a save of your form using JS code.

    To learn how to develop JS scripts for Dynamics forms, I suggest you follow this tutorial: docs.microsoft.com/.../walkthrough-write-your-first-client-script

    Then you can trigger your save with the formContext.data.save() method. You can refer to the following documentation: docs.microsoft.com/.../save

    Also, if you want to cancel the standard save of the form and keep only the save you want to implement, it is recommended to use the preventDefault() function:

    docs.microsoft.com/.../preventdefault

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans