Hi
I have a subgrid on separate tab on the form. I want to trigger a flow on add or removal a row on this subgrid.
I read many posts which suggest adding an "addOnLoad" event to the subgrid. Which gets triggered automatically when subgrid refreshes on load.
I am not able to access the grid by its name, as the tab where subgrid is set has many sections and I have to loop through those sections to access the subgrid control object.
When I get the grid object when I add the addOnLoad event I am seeing error like "grid.addOnLoad" is not a function
Here is my code: on the Onload event of the form I am adding this code
var tabClients=Crm.Context.ui.tabs.get("tab_clients");
tabClients.sections.forEach(function (section, sectionIndex)
{
if (section.controls._collection!=null && section.controls.getByName("ClientWorkers")!=null)
{
var grid =section.controls.getByName("ClientWorkers").getGrid();
grid.addOnload(ClientgridOnLoad); (this line is giving error)
}
});
ClientgridOnLoad:function(){
setTimeout(()=>
{
Some code here
}, 5000);
},
When I debug the javascript I don't see any prototype function like "addOnLoad"
I just see functions like getRows(), getTotalRecordCount() etc.
Appreciate if anyone can help me on this.
Thanks
Nalina