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

  • RE: Getting the value of object using javascript

    Thank you so much!!!!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: Getting the value of object using javascript

    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)

  • Suggested answer
    RE: Getting the value of object using javascript

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans