Fix Editable Grid Click Events Not Triggering in Dynamics 365
Question details
The user needs to resolve an issue where a JavaScript web resource event handler fails to trigger when clicking or selecting a row in a Microsoft Dynamics 365 editable grid.

- Product
- Microsoft Dynamics 365
- Device & OS
- not provided
- Scenario
- Attempting to trigger a custom JavaScript function upon selecting or clicking a row within an editable grid.
- Observed behavior
- The JavaScript web resource event handler does not execute when a row is clicked or selected in the editable grid.
Ensure you have the System Administrator or System Customizer security role in Dynamics 365 to access the form editor, edit grid properties, and publish customizations.
Switch to Supported Editable Grid Events (OnRecordSelect)
Standard DOM click handlers are unsupported in editable grids; you must configure native Dynamics 365 Client API events like OnRecordSelect to ensure the script triggers correctly.
Microsoft Dynamics 365 editable grids have specific client-side events and do not expose standard HTML row-click events. Relying on DOM click handlers will fail.
Instead, map your JavaScript web resource to the supported OnRecordSelect event, which is designed specifically for this scenario.
Navigate to Dynamics 365 Settings > Customizations > Customize the System, expand the relevant entity, and open the Form containing the editable grid.
Double-click the editable grid control on the form to open the 'Set Properties' dialog box.
Navigate to the 'Events' tab. Under the 'Event Handlers' section, change the event dropdown to 'OnRecordSelect'.
Click 'Add', select your JavaScript web resource library, input the exact function name, and check the box for 'Pass execution context as first parameter'.

Publish Customizations and Clear Browser Cache
Event handler changes may not reflect in the user interface until all customizations are explicitly published and your browser cache is cleared.
Debug with Browser Developer Tools
Identify hidden syntax or runtime errors in your JavaScript web resource that might be preventing the event from executing.
Enhance Your Productivity with WPS Office
While Dynamics 365 handles your CRM and ERP workflows, you often need to export grid data for reporting or draft detailed documentation. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, allowing you to effortlessly view, edit, and manage your exported Word, Excel, and PowerPoint files with a familiar UI.
- 1. Visit the Official Website: Go to the official WPS Office website to access the latest free version.
- 2. Download the Installer: Click the 'Download' button corresponding to your operating system (Windows, Mac, or Linux).
- 3. Install and Run: Open the downloaded installer file and follow the straightforward on-screen instructions to set up WPS Office on your device.

Frequently Asked Questions
Why is my OnRecordSelect event not firing in Dynamics 365?
The OnRecordSelect event may not fire if the web resource is not properly linked in the editable grid's event handlers, if 'Pass execution context' is unchecked, or if there is a syntax error in your JavaScript code preventing the execution.
Can I use standard HTML onClick events on a Dynamics 365 editable grid?
No, Microsoft Dynamics 365 editable grids do not support direct HTML DOM manipulation or standard onClick events. You must use the supported Client API object model events, such as OnRecordSelect or OnChange.
How do I pass the execution context to my editable grid JavaScript function?
When configuring the event handler in the Form Editor's grid properties, double-click the assigned event handler and ensure the checkbox labeled 'Pass execution context as first parameter' is ticked in the Handler Properties dialog box.




