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

Announcements

News and Announcements icon
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

I have the same question (0)
  • RaviKashyap Profile Picture
    55,410 Moderator on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans