locked
Can we force enter (show a popup) on a lookup field when a form is loaded (OnCreate) RRS feed

  • Question

  • Hi,

    On a particular form (Oncreate) we need a lookup window for the customer attribute to automatically pop-up. What we want is for users to enter part of the postcode and hit enter, popping up the customer lookup.  That is fine unless a user tabs in which case it tries to auto-complete and does not pop-up the window.  Is there a way we can automatically pop-up the lookup window on either enter or tab?

    Thanks in advanced :)

     

    Friday, May 28, 2010 9:10 AM

Answers

  • if you place your code that calls the popup in a function the you can set the onblur event of the field. This will fire your code when oever the focus is lost on your field.

    crmForm.all.yourField.onblur = yourfunction;

    You could use the JavaScript attachEvent method instead but there is nothing on onblur I'm pretty sure anyway so you shouldn't be overwriting existing events.

    crmForm.all.yourField.attachEvent('onblur', yourfunction);

     

    You could place some code  in yourFunciton to check if the value has changed and only run if it has.

    if(crmForm.all.yourField.DataValue != crmForm.all.yourField.DefaultValue){

    // Load your popup

    }


    MSCRM Bing'd - http://bingsoft.wordpress.com
    • Marked as answer by Jim Glass Jr Thursday, September 9, 2010 5:07 PM
    Friday, May 28, 2010 11:22 AM
    Moderator