I have an editable subgrid on a form in my model-driven app. I need to update the parent entity each time a change is made to a field on the subgrid. I attached some javascript to the onChange event of the subgrid. The event fires as expected, but I don't seem to be able to access the parent entity.
function onLikelihoodChange (executionContext){
var formContext = executionContext.getFormContext();
var entityId = formContext.data.entity.getId().replace('{', '').replace('}', ''); //get child entity; want parent entity
refreshRoleupField(executionContext, 'pm_preliminaryriskassessments', entityId, 'pm_answeredcount');
console.info(entityId);//gives id of child entity
}
Can I access the parent entity from the executionContext of the subgrid? Or do I need create some kind of listener function for the main form that "hears" the subgrid change?
What's the best way to do this?