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