Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

get total records count in the subgrid, crm 2016

$
0
0

Hi,

I have a subgrid in a CRM 2016 form.

I want to check the count of records in the subgrid, and if it is more than one I should make a field readonly on the form.

I tried to get rowsCount as below

Xrm.Page.getControl("name").getGrid().getTotalRecordCount(), but it is returning -1.

(I have added  Xrm.Page.getControl("name").addOnLoad(myFunction) at form load.

And also refreshing subgrid on form load)

I need to check the countofrecords onLoad of the form and Add/Remove of items on the subgrid.

(My Subgrid is a custom subgrid, which gets data using custom fetchxml query)

Need your suggestions.

Thanks



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>