Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Refresh Form on Subgrid Event -refresh is going into an endless loop

$
0
0

I have a requirement to refresh the form when a sub grid event occurs like add a new record, delete or deactivate a new record.

The refresh is needed because of a calculated/rollup field that needs o be refreshed.

I have an idea using the addOnLoad event of the grid , but the refresh is going on an infinite loop.

My Code is

 

function SubgridEventListener(executionContext)
 {
	let formcontext = executionContext.getFormContext();
	let gridContext = formcontext.getControl("subgridName");
	let gridEvent = function () { formcontext.data.refresh(false);};
	//ensure that the subgrid is ready…if not wait and call this function again
	if (gridContext == null) {
		setTimeout(function () { gridEvent(); }, 15000);
		return;
	}
	//bind the event listener when the subgrid is ready
	gridContext.addOnLoad(gridEvent);
}

Is there any way to implement this with Javascript.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



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