Search code examples
dynamics-crm-2011dynamics-crmdynamics-crm-4dynamics-crm-online

crm 2011 Subgrid record selected/OnFocus Event


I have a subgrid on my contact entity.

This is image

I want that when the first record is selected in the subgrid above buttons enables and disables on uncheck.

I know how to enable diable button but i dont know where/how to call my function.


Solution

  • Try this code on the OnLoad Form event, to access the subgrid onClick Event.

    function OnLoad() {
        var subGridId = gridId + "_d";
    
        var grid = document.getElementById(subGridId);
    
        if( grid != null){
            grid.onclick = ClickAction;
        }
    
    }
    
    function ClickAction() {
        //insert your Click action here.
    }