locked
CRM 2013 SP1 : JScript function on Account Activity subgrid keep repeating RRS feed

  • Question

  • I have CRM 2013 with Account Entity Activities sub grid needs to set Filter on when Activities get loaded. So i created on Activity subgrid button and set EnableRule property to fire one JScript function to enable filter like below .

    function enableActivityFilterButtonImage() {
        try {     
            debugger;        
                actFilter = document.getElementById("filterButtonImage");
                if (actFilter) {   document.getElementById('filterButtonImage').click();
                    
                }
                return false;        
        } 
    }

    For some reason, when i open related Activity link from Account Entity, this JScript function keep repeating.

    Any idea how can i prevent this repeating JScript function??

    Wednesday, August 6, 2014 7:46 PM

Answers

  • Any one have any idea??
    • Marked as answer by Nicksoft2011 Monday, September 29, 2014 12:49 PM
    Thursday, August 7, 2014 12:18 PM
  • I resolved this by  below code and firing this script from Activity Subgrid Ribbon using Enable Rule:-

    function enableActivityFilterButtonImage() {
        try {              
            var actFilter = document.getElementById("filterButtonImage");
            var loadingmessage = document.getElementById("GridLoadingMessage");
                if (actFilter) {                
                    if (actFilter.parentElement.parentElement.className === "ms-crm-List-FilterButton" && loadingmessage == null ) {                  
                        document.getElementById('filterButtonImage').click();
                    }
                }        
                return false;        
        } catch (ex) { alert('JavaScript Error In enableActivityFilterButton:' + ex.description); }
    }

    • Marked as answer by Nicksoft2011 Monday, September 29, 2014 12:49 PM
    Wednesday, August 13, 2014 2:40 PM

All replies

  • Any one have any idea??
    • Marked as answer by Nicksoft2011 Monday, September 29, 2014 12:49 PM
    Thursday, August 7, 2014 12:18 PM
  • I resolved this by  below code and firing this script from Activity Subgrid Ribbon using Enable Rule:-

    function enableActivityFilterButtonImage() {
        try {              
            var actFilter = document.getElementById("filterButtonImage");
            var loadingmessage = document.getElementById("GridLoadingMessage");
                if (actFilter) {                
                    if (actFilter.parentElement.parentElement.className === "ms-crm-List-FilterButton" && loadingmessage == null ) {                  
                        document.getElementById('filterButtonImage').click();
                    }
                }        
                return false;        
        } catch (ex) { alert('JavaScript Error In enableActivityFilterButton:' + ex.description); }
    }

    • Marked as answer by Nicksoft2011 Monday, September 29, 2014 12:49 PM
    Wednesday, August 13, 2014 2:40 PM