hi Guys,
how to count subgrid records and store the record count in one field using plugin.It is possible to do using plugin.
thank you
*This post is locked for comments
hi Guys,
how to count subgrid records and store the record count in one field using plugin.It is possible to do using plugin.
thank you
*This post is locked for comments
Hi Dinesh,
you can create a rollup field and have the condition to see the records count. quick help link - community.dynamics.com/.../count-the-number-related-child-records-using-a-rollup-field
hmm , why not you use service.RetrieveMultiple passing subgrid reference and get the result length.
Hi,
Rollup field cannot fullfill your requirements?
Thank You Goutam..but i want to do that process in plugin
Hi Dinesh,
Try with this -
function getTotalGridRecordCount() { debugger; try { setTimeout(function () { // Replace Grid name if (Xrm.Page != null && Xrm.Page != undefined && Xrm.Page.getControl("contactopportunitiesgrid") != null && Xrm.Page.getControl("contactopportunitiesgrid") != undefined) { var count = Xrm.Page.getControl("contactopportunitiesgrid").getGrid().getTotalRecordCount(); //alert("Total Opportunities:"+count); Xrm.Page.getAttribute("new_fieldName").setValue(calculatedproductfield); // Replace Field Name } }, 5000); } catch (e) { Xrm.Utility.alertDialog(functionName + "Error: " + e.message || e.description); } }
community.dynamics.com/.../count-total-subgrid-records-in-dynamics-crm-using-javascript
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156