Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Uncaught TypeError: Cannot read properties of undefined (reading 'REST'

Posted on by 5

I have been using this code to open an look up window it is throwing an error "Uncaught TypeError: Cannot read properties of undefined (reading 'REST'"

Please help me in getting out of this!

var strAccountFilter = "$filter=AccountId eq (guid'" + strAccountId + "')";
//var DefaultViewId = Xrm.Page.getControl("cmc_carrieridaccount").getDefaultView();

parent.SDK.REST.retrieveMultipleRecords("Account", strAccountFilter, getAccountOnSuccess, errorHandler, function () { });

}

function getAccountOnSuccess(result) {
if (result == null || result.length == 0)
return;

var strURL = "_controls/lookup/lookupinfo.aspx?AllowFilterOff=0&DefaultType=11129&DefaultViewId=%7bEA7EB181-7C13-4466-A681-87A22A54A9D9%7d&DisableQuickFind=0&DisableViewPicker=0&IsInlineMultiLookup=0&LookupStyle=single&ShowNewButton=1&ShowPropButton=1&dType=1&mrsh=false&objecttypes=11129&rDependAttr=quote.cmc_accounttoquoteid&rId=";

strURL += "{" + result[0].AccountId + "}&rType=1&relationshipid=cmc_account_cmc_carrier_CarrierIDAccount";

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Uncaught TypeError: Cannot read properties of undefined (reading 'REST'

    HI,

    Use Xrm.WebApi.RetrieveMultipleRecords instead of parent.xrm.sdk.Rest

    docs.microsoft.com/.../retrievemultiplerecords

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans