Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

JS create record get guid

Posted on by 395

Hi,

I create record in js with sdk

There is any way to get the guid of the created record?

Thanks!

*This post is locked for comments

  • FikriHailal Profile Picture
    FikriHailal 115 on at
    RE: JS create record get guid

    $.ajax({
    type: "POST",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/lnkt_troubleticketSet",
    data: JSON.stringify(entity),
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    },
    async: true,
    success: function (data, textStatus, xhr) {
    var newEntityId = data.d.lnkt_troubleticketId;
    alert(newEntityId);
    },
    error: function (xhr, textStatus, errorThrown) {
    alert(textStatus + " " + errorThrown);
    }
    });

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: JS create record get guid

    Hello,

    refer below.

    365dynamicscrm.wordpress.com/.../webapi-javascript-to-create-a-record

    Mansoor

  • Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: JS create record get guid

    Hi,

    You can use the following code for getting the guid of the record.

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

    This returns the ID of the record created.

    Refer the link below.

    https://crmbusiness.wordpress.com/2014/02/17/crm-2013-javascript-to-get-id-of-record/

    Hope this helps

    Thanks

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans