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)

Is it possible to get data using ajax

(0) ShareShare
ReportReport
Posted on by 645

I have a JS function that using ajax to fire a function in server side, on the server side I create a record and I need to get the new GUID of the new record by using the guid I want to open the specific record. Can I transfer the guid that was created in the server side to the client side (client side) ? is it possible and supported? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shaminderpal Singh Profile Picture
    1,565 on at

    Hi Sahara,

    Yes you can do it,however your serverside fn has to be an action which after creation should return an output parameter of type entityreference.You can invoke your action using xmlhttprequest /Ajax.

    -Shaminder

  • sahara Profile Picture
    645 on at

    Hey Shaminder

    can you please add a link to your answer ?

  • Suggested answer
    ARIFNIIT Profile Picture
    1,391 on at

    You can use custom action and call it through Ajax call.

    Refer below link

    community.dynamics.com/.../use-javascript-to-call-a-custom-action-and-to-display-an-error

  • Parashuram Profile Picture
    381 on at

    Hi Sahara,

        I assume that you are trying this ajax call in web resource and in c# code you might have written function to create record.If that is the case you can call the Web api with action return type json :

    e.g.

    jQuery.ajax({

        type: "GET",

        url: 'api.geonames.org/postalCodeLookupJSON;country=AT&username=demo',

        dataType: "jsonp",

        cache: false,

        crossDomain: true,

        processData: true,

        success: function (data) {

            alert(JSON.stringify(data));

        },

        error: function (XMLHttpRequest, textStatus, errorThrown) {

            alert("error");

        }

    });

    Hope this helps,

    Parashuram Jadhav

  • Community Member Profile Picture
    on at

    Hi this can be done using standard javascript on a promise. The create script will return your Guid natively.

  • Ama AMV Profile Picture
    88 on at

    Hi, how can we send the data to the c# code?

  • Suggested answer
    ARIFNIIT Profile Picture
    1,391 on at

    AMA AMV: you can input parameters in Action using JavaScript and you can use it in custom action. 

    refer below article

    https://community.dynamics.com/crm/b/crminogic/archive/2016/12/20/execute-action-with-entitycollection-parameter-using-web-api-in-dynamics-365 

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