Skip to main content

Notifications

Announcements

No record found.

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

XRM.WEBAPI not working in crm solution configuration.html web resource

Posted on by 20

Hi,

i am using XRM.WebApi to retrieve records but when execute  i get error in script. error :""Cannot read property 'account'  of null".

is there any solution for this ?

  • RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    Hi, if you paste the number I can try to speed up things as I will take it

  • Nuwan Chamara Profile Picture
    Nuwan Chamara 20 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    yes i will raise it to them. they will open a case. thanks and i will try  again.

  • RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    Is it possible for you to open a case and send here the number?

  • Nuwan Chamara Profile Picture
    Nuwan Chamara 20 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    i believe so. however they are using this  ClientGlobalContext.js.aspx. i believe this is suppose to define Xrm object

  • Nuwan Chamara Profile Picture
    Nuwan Chamara 20 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    i tried it i did not work. they are using this  <script type="text/javascript" language="javascript" src="ClientGlobalContext.js.aspx"></script>

    as well

  • RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    I've just copied and paste your code into the console app.

    If the problem was "Xrm not defined" i would use the parent.Xrm like Marco suggested but I think the problem must be somewhere else.

  • Suggested answer
    Marco.P Profile Picture
    Marco.P 2,405 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    Hi,

    try with:

    parent.Xrm.WebApi.online

    Hope it helps,

    Marco

  • Nuwan Chamara Profile Picture
    Nuwan Chamara 20 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    will you be able to show me the code? i will compare it and it will be a great help thanks

  • RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    Hi,

    This is working fine for me, don't see any problem with it.

  • Nuwan Chamara Profile Picture
    Nuwan Chamara 20 on at
    RE: XRM.WEBAPI not working in crm solution configuration.html web resource

    unfortunately i can not give the entire code. how ever i can give the retrieve that i am try in to do.

    Xrm.WebApi.online.retrieveMultipleRecords("account", "?$select=accountid").then(

                   function success(results) {

                       for (var i = 0; i < results.entities.length; i++) {

                           var accountid = results.entities[i]["accountid"];

                       }

                   },

                   function (error) {

                       Xrm.Utility.alertDialog(error.message);

                   }

               );

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans