web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting the value of object using javascript

(0) ShareShare
ReportReport
Posted on by

Hello dears,

i have used fetchXml to retrieve value of a field from other entity,

in the below code when im trying to retrieve the value of userChannel using  userChannel .getValue() or userChannel.[0].id  im getting  this error  "Object doesn't support property or method 'getValue' at successCallback".

so what i should do to read the value ? Thanks in advance

XrmSvcToolkit.fetch({
fetchXml: fetchXml,
async: false,
successCallback: function (result) {
if (result.entities.length > 0) {

userChannel = result.entities[0].new_channel;

}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    Use the debbuger and set a breakpoint on the line of userChannel. Then you can see of what is consisting your UserChannel.

    Then you can use the correct function to get the desired value.

    Best

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     getValue etc are methods defined in the Xrm library - they are not applicable to the results returned from that fetch call.

     From what I can see, you just need to use

    result.entities[0].new_channel.Id

    or

    result.entities[0].new_channel.Name

    abhishekcrm.blogspot.ca/.../xrmsvctoolkitfetch-examples.html

    But I'd agree with Guillaume - just add a breakpoint and see what's in there (you can also add

    debugger;

    to your javascript to make it stop automatically.. just don't forget to open dev tools using F12)

  • Community Member Profile Picture
    on at

    Thank you so much!!!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans