locked
What's the equivalent of an attachevent of CRM 4 within CRM 2011 ? RRS feed

  • Question

  • I have seen that "attachevent" is not supported anymore within a javascript web resource of CRM 2011.

    How can we attach event handler to javascript events (like onblur etc...) in a CRM 2011 javascript library ?

    Many thanks in advance,


    Bianca
    Thursday, May 19, 2011 2:20 PM

Answers

  • Hi,

    You could attach event as stated below,

    var el = document.getElementById(id);

    // Build your function with the help of below example
      var f = "var ef=function() { " +
          
    "GridClick('"+pgrid+"','"+sgrid+"','"+sfield+
          
    "','{00000000-0000-0000-0000-000000000000}');"+
          
    " };";

      eval(f);

    // Attach to click event
      el.attachEvent("onblur", ef, false);

     


    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html
    Saturday, May 21, 2011 5:53 AM