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)

SDK.REST retrieverecord keeps returning no results when data exist

(0) ShareShare
ReportReport
Posted on by 1,532

I can't figure out why the SDK.REST.RetrieveRecord is not returning results when the data does exist.

On my form properties I have all the necessary SDK  library's that are needed.  The code is also not falling into the errorhandler.

Any ideal on what I am doing wrong?

FormPage.JPG

When debugging the retrieverecord is returning me results is not defined.

SDK.REST.JPG

Error message

0407.ErrorMessage.JPG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi rthompson,

    To solve this problem you need to declare results, or you need make sure it is available in your current script or scope.

  • Verified answer
    Abby Kong Profile Picture
    6 on at

    Hello rthompson,

    From the image, results' variable scope is only inside function(results){...} and the break-point is on the last line outside the scope.

    Can you please break(debug) inside function(results){} to the check value of results?

    You can put a line debugger; inside function(results){} to make sure it breaks inside the scope and check the value with console.

    Regards,

    Abby

  • Verified answer
    rthompson Profile Picture
    1,532 on at

    Hi Abby,

    I found my problem.  The the GUID {F2D2679F-9C1A-E811-80DA-005056BA7CE0} was returning {}.

    The method is now working correctly once I removed the {}.

    function getselectorclauseprofile(selectortemplateid) {

        var entityName = "new_selectortemplate";
    
        SDK.REST.retrieveRecord(

           selectortemplateid.replace(/{/g,'').replace(/}/g,''),
           'new_selectortemplate',        'new_name,new_ClauseNumberId',        null,        function (results) {            var itype = 'none' //results.new_ClauseNumberId.Id;            Xrm.Page.getAttribute("new_ClauseNumberId").setValue(itype);        },        errorHandler     ); }

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock 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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans