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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

getting Entity Record ID on Save from Quick Create Form

(0) ShareShare
ReportReport
Posted on by

I've added on Save event for Account Quick Create form and try to get the new record id in that event. but getting it empty. 

Here is the code that I'm using to get the ID. 

Xrm.Page.data.entity.getId();

Is there any way i can get the id of the new record once it is saved ?

Thanks,

Himal

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Jeroen de Wit Profile Picture
    on at

    I think Javascript won't do the trick here as the OnSave event will trigger before actually writing data back to the database.

    What would you like to do with the ID of the account record? The easiest way would be to use a PostCreate plug-in on the account entity. There you will have access to the ID of the record and then you can write it to a field, or set relationships to other entities etc.

    Kind regards,

    Jeroen de Wit

  • Suggested answer
    Hosk Profile Picture
    on at

    this function will get the guid/id of the record, if you put it on the onload, this will run right after you have saved the record.  I tested it on a normal form

    function SetGuid() {

    //1 == createform

    //2 == update

        if (Xrm.Page.getAttribute('new_oppid').getValue() == null) {

            var guid = Xrm.Page.data.entity.getId();

            Xrm.Page.getAttribute('new_oppid').setValue(guid)

        }

    }

  • Community Member Profile Picture
    on at

    It works

  • Community Member Profile Picture
    on at

    Hi.. I want to retrieve current record guid after save.

    I m saving my record using javascrpt. My record save but does give me guid

    please explain me in brief. How can I get guid .

    Thanks in Advance

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans