Getting selected record in a Subgrid using executioncontext - Moazam Badane's Blog

In this post, we will look at how to get selected record from a subgrid using executionContext.

Note this will work on Editable grids, using OnRecordSelect event.

Consider a scenario where you have subgrid of Contact on Account,


Now change property of the grid to Editable Grid.


Which means we can use OnRecordSelect event


we need to add code to OnRecordSelect, to get the id of selected record.

function RecordSelected(executionContext) {
   var selected = executionContext.getFormContext().data.entity;
   var id = selected.getId();
   alert(id);
}

now when we run this, selecting record id will display an alert.



Post a Comment

0 Comments