Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The OnRecordSelect
event occurs when a single row (record) is selected in an editable grid. This event doesn't occur if a user selects different cells in the same row, or selects multiple rows.
When you want to customize the way that a table record opens from the Power Apps grid control, you can control how this opens with a JavaScript function associated with the grid OnRecordSelect
event.
The following example ensures that the record opens using the form specified by the pageInput
formId
value using the Xrm.Navigation.navigateTo method. In this example, the form and grid must belong to the same entity.
Create, save, and publish a JavaScript (JS) web resource that contains the following code:
var Example = window.Example || {};
(function () {
this.OnSelect = function (executionContext) {
var pageInput = {
pageType: "entityrecord",
entityName: executionContext.getEventSource().getEntityName(),
entityId: executionContext.getEventSource().getId(),
formId: "420786E3-D342-4A9A-914B-AA331FF2D25E"
};
Xrm.Navigation.navigateTo(pageInput);
}
}).call(Example);
More information: Create or edit model-driven app web resources
Follow these steps to enable the Power Apps grid control as the main grid (table view) or within a model-driven form subgrid:
When you enable the Power Apps grid control, an Events tab appears. Select the Events tab:
Example.OnSelect
. This is the name of the JavaScript function created in the web resource. Make sure to check the option Pass execution context as first parameter.More information: Power Apps grid control
Events (Client API reference)
Events in forms and grids in model-driven apps
Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn more