Refresh CRM 2011 Opportunity form when Opportunity product is added using Javascript.

已答复 Refresh CRM 2011 Opportunity form when Opportunity product is added using Javascript.

  • Samstag, 16. Juni 2012 18:32
     
     

    I added a field to the opportunity form and Javascript function to subtract the discount percentage from the estimated value of the opportunity on change of the discount field. Unfortunately the estimated value remains 0.00 when a value is entered and the discount is not calculated unless the form is refreshed before the discount is entered. Is there a way to refresh the page when a new product is added to the opportunity so the estimated value is updated on the form. I tried the code below on the onLoad event of the opportunity form but it does not work. Please help...Thanks in advance.

    function opportunityLoad() {
        var grid = document.getElementById("opportunityproductsGrid");
        grid.attachEvent("onrefresh", reLoadOpportunity);
    }

    function reLoadOpportunity() {
        window.location.reload(true);
    }

Alle Antworten