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. Image for the cookie policy date

Microsoft Dynamics CRM 2013 OData

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

8 Replies

MM Michele Mazzucco 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


MM Michele Mazzucco 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.


YO Yogeshwaran Syncfusion Team 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



MM Michele Mazzucco 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


MF Mohammed Farook J Syncfusion Team 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



BM Balaji Marimuthu Syncfusion Team 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



MM Michele Mazzucco January 4, 2016 08:51 AM UTC

Hi Balaji,
thanks for the update.

Regards,
Michele 


BM Balaji Marimuthu Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon