We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Microsoft Dynamics CRM 2013 OData

Thread ID:

Created:

Updated:

Platform:

Replies:

116977 Jul 14,2014 04:08 PM UTC Jan 5,2016 05:29 AM UTC JavaScript 8
loading
Tags: ejGrid
Michele Mazzucco
Asked On July 14, 2014 04:08 PM UTC

Hello,
I am trying to configure a DataManager to get data from a CRM 2013 OData query.
The problem I am facing is that DataManager is automatically adding the "$inlinecount" parameter to the request.
Since Dynamics CRM 2013 is currently implementing only OData V1 some parameters are not supported and I am getting following error message from the server:

Row counts cannot be requested when the MaxProtocolVersion of the data service is set to DataServiceProtocolVersion.V1

If I intercept the query request with the browser tools, and I remove the "inlinecount" parameter from the request, it will run just fine.
So I am wondering if there is a way to disable this parameter in Javascript when initializing ej.DataManager, ej.Query or ej.Grid.
I see from documentation that Query has an addParams method, but I can't see any removeParams or such.

What could you suggest to try to have a workaround about this?

Thanks,
Michele

Michele Mazzucco
Replied On July 15, 2014 12:50 PM UTC

some additional info:

I am trying to achieve some result by implementing a custom adaptor as shown in the User Guide.
But unfortunately there is only one basic example of extending ej.Adaptor in the User Guide,
and I am not able to find detailed API reference for the base adaptor class.
In fact, with debug I can see that the "$inlinecount" parameter is configured through a "count" property in the adaptor of the DataManager.

Maybe there could be a way to implement a custom adaptor and tweaking this behavior in the processQuery method?
Any help would be kindly appreciated.




Attachment: 20140715_14_48_29F12_e41b474a.zip

Michele Mazzucco
Replied On July 15, 2014 01:29 PM UTC

I haven't been able to achieve some result with custom adaptor.
So I tried by overriding the following method of the query object in this way:

requiresCount = function(){return false}

With this workaround the OData request can be performed against CRM 2013, however this will totally break the paging functionalities, and probably something else...
I think I'm out of ideas now.

Yogeshwaran [Syncfusion]
Replied On July 18, 2014 01:07 PM UTC

Hi Michele,

 

Sorry for the inconvenience caused. Please find the response.

 

breaking the paging functionalities

To avoid this issue . you can manually update pager count based on your retrieved $inlinecount.  Please find the API to update pager.

 

[script]

gridObject.getPager().ejPager("model.totalRecordsCount", "totalRecordsCount");

 

or else

 

if the above API is not helpful, you can use offline property in DataManager to avoid this issue which retrieve data from server at one time and update pager based on records count . Please refer below url link.

 

http://js.syncfusion.com/demos/#!/azure/grid/DataBinding/Loadatonce

 

 

Regards,

Yogesh R


Michele Mazzucco
Replied On July 18, 2014 03:12 PM UTC

Thanks for the hint!
I tried and both approaches seems to be a valid workaround.

Just a few remarks about pager APIs:
  1. please be aware that getPager method for ejGrid is new in 12.2, while in 12.1 you should use getGridPager instead
  2. the ejPager("model.totalRecordsCount", "totalRecordsCount") instruction should be executed AFTER the grid has finished loading data: I tried to call it just after ejGrid constructor, but at runtime the pager gets updated while the grid is still loading, and when records are displayed in the grid the pager get reset to default values losing the totalcount info
For the moment I'll stick with the offline mode, which is just fine for my page.
But for sure the pager API could be a valid workaround when needing to have incremental load.

Thanks for the hints!

PS: I think it would be good to add pager class in API Reference documentation, as I can only find ejOlapPager at the moment

Mohammed Farook J [Syncfusion]
Replied On July 22, 2014 06:12 AM UTC

Hi  Michele Mazzucco,

We have considered to create API class for ejPager. This will be available in our any of our upcoming releases.


Thanks with Regards,

J.Mohammed Farook


Balaji Marimuthu [Syncfusion]
Replied On January 4, 2016 07:38 AM UTC

Hi Michele,

We have published the “API Reference for ejPager” documentation in online and please find the document in following link. http://help.syncfusion.com/js/api/ejpager

Please let us know if you have concerns.

Regards,
Balaji Marimuthu


Michele Mazzucco
Replied On January 4, 2016 08:51 AM UTC

Hi Balaji,
thanks for the update.

Regards,
Michele 

Balaji Marimuthu [Syncfusion]
Replied On January 5, 2016 05:29 AM UTC

Hi Michele,

Thanks for the update. Please get back to us if you need any further assistance.

Regards,
Balaji Marimuthu

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;