I have the below code running to popup a warning if a subgrid contains data.
However, the row count always returns 0 even when there is data in the subgrid.
I found another post where there was a suggestion that the subgrid MUST be on the summary tab of the form, so i moved the subgrid and still it returns 0.
function AssetAdvisoryWarning(executionContext) {
var formContext = executionContext.getFormContext();
var gridContext = formContext.getControl(/asset_advisories/);
var myRows = gridContext.getGrid().getTotalRecordCount();
console.log(/row count (/+myRows+/)/)
if (myRows > 0) {
formContext.ui.setFormNotification(/This asset has (/+myRows+/) advisories./, /WARNING/);
}
}