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)

How to get all the fields using FetchXML & Javascript as per View in MS Dynamics CRM?

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to get all the fields for records of a particular view.

Here I'm getting only a few fields for records. 

{

var req = new XMLHttpRequest();
req.open("GET", serverUrl + "/api/data/v8.0/" + apiEntityName + "?fetchXml=" + encodedFetchXML, false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");
req.onreadystatechange = function () {

if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {

var results = JSON.parse(this.response);

}
else {
alert(this.statusText);
debugger;
}
}
};
req.send();
}

}

Can anybody suggest me how to get all the fields using FetchXML or something else?

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Iswarya Profile Picture
    1,347 on at

    Hi,

    refer this link

    mscrmtutorials.blogspot.in/.../retrieve-all-attributes-using-fetchxml.html

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Chhaya,

    please use all-attributes tag to retrieve all attributes for a given entity.

    An example follows:

    <fetch mapping='logical' page='1' count='10'> 
       <entity name='account'> 
          <all-attributes /> 
         <filter type='and'> 
             <condition attribute='createdon' operator='today' /> 
          </filter> 
       </entity> 
    </fetch>

    Hope it helps!

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Community Member Profile Picture
    on at

    Hi  Chhaya Patel,

    if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Chhaya Patel,

    if you solved the problem thanks to an answer, please mark it as verified to encourage the community to provide more and more a better support. Thank you. Francesco

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.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

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