Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

No Other Query options supported when SavedQuery or UserQuery or FetchXml option is provided.

(0) ShareShare
ReportReport
Posted on by 244

Hello All,

I am try to access the Entity records using the Web api and Datatables,Using noraml web api  ,DataTables.js  and ADAL.js ,Please find the following code,its throwing following error 500,

    var fetchxml = "<fetch mapping='logical' page='2' count='10' returntotalrecordcount='true' pagingcookie='%253ccookie%2520page%253d%25221%2522%253e%253caccountid%2520last%253d%2522%257bB8A19CDD-88DF-E311-B8E5-6C3BE5A8B200%257d%2522%2520first%253d%2522%257b475B158C-541C-E511-80D3-3863BB347BA8%257d%2522%2520%252f%253e%253c%252fcookie%253e'>" +
"  <entity name='account' >" +
"    <attribute name='address1_city' />" +
"    <attribute name='name' />" +
"  </entity>" +
"</fetch>";
 
 
            $("#example").DataTable({
                "processing": true,
                "serverSide": true,
                "aoColumnDefs": [
{ bSortable: true, aTargets: [0] },
{ bSortable: false, aTargets: ['_all'] }
                ],
                "ajax":
                    {
                        url: encodeURI(organizationURI + "/api/data/v9.0/accounts?fetchXml=" + fetchxml),
                        dataType: 'application/json',
                        method: 'GET',
                        'beforeSend': function (request) {
                            request.setRequestHeader("Authorization", "Bearer " + token);
                        },
                        data: function (d) {
                            return d;
                        },
 
                    },
                columns: [
        { title: "Name" },
        { title: "City" },
 
                ]
            });

One more question,passing of bearer in Datables.

Thank,

*This post is locked for comments

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: No Other Query options supported when SavedQuery or UserQuery or FetchXml option is provided.

    Hi Sairam,

    Basically this error means you cannot set any other option when using fetchxml. It seems along with fetchxml, you are also passing using something else. You can use fiddler or developer tool (network) to see the request which is building and identify what is it adding. You can also use Postman to confirm you implementation before actualy trying it oin code.

    docs.microsoft.com/.../use-postman-web-api

    Hope this helps.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans