locked
onchange even on a picklist RRS feed

  • Question

  • on change event on the picklist (assign to) is not getting fired

    i have even tried

      crmForm.all.<field>.onchange = function() {<your code>}

    Tuesday, November 10, 2009 10:04 AM

Answers

  • Ownerid isn't a picklist, it's a lookup field. Do you need help with firing the OnChange event on a picklist or a lookup?

    • Marked as answer by Jim Glass Jr Thursday, November 12, 2009 5:25 PM
    Wednesday, November 11, 2009 10:41 AM
    Moderator
  • Hi Varun,

    Ownerid is a lookup field.

    The onchange script will work in case of new record only, it won't work for existing records.



    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    • Marked as answer by Jim Glass Jr Thursday, November 12, 2009 5:25 PM
    Wednesday, November 11, 2009 10:56 AM

All replies

  • What is your need?

    You want to change the script associated with the picklist in a dynamic manner?

    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Tuesday, November 10, 2009 10:12 AM
    Moderator
  • i need to do some operations on the other attribute depending on the assign to picklist values

    if the end user changes the assign to i need to change some other attribute value
    Tuesday, November 10, 2009 10:13 AM
  • Ok, but I don't understand why you don't simply use the field onchange event in the form customization...
    My blog : http://mscrmtools.blogspot.com You will find: Form Javascript Manager (export/import javascript from forms) ISV.Config Manager (graphical ISV.config edition - export/import) View Layout replicator (customize one view and replicate to others) And others (use tool tag on my blog)
    Tuesday, November 10, 2009 10:15 AM
    Moderator
  • it is not working
    Tuesday, November 10, 2009 10:16 AM
  • i have kept and alert box for testing but the event never gets executed

    i have also tried this code in the onload event

    crmForm.all.<field>.onchange = function() {<your code>}

    but both of them has no effect when i change the value in the pick list

    Tuesday, November 10, 2009 10:18 AM
  • Hi Varun,

    It could be the case that the checkbox "Event is enabled" for that field could have got unchecked unknowingly.
    Or it could be some syntax error in JavaScript for that form. 

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    Tuesday, November 10, 2009 10:28 AM
  • Thanks for the reply

    but it the check box is checked i mean the event is enables but it is not firing the event
    Tuesday, November 10, 2009 10:32 AM
  • Hi Varun,

    Try by disabling JavaScript for other fields on the form and for the form itself.
    May be it could be because of the error in JavaScript for other fields on the form.

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    Tuesday, November 10, 2009 10:42 AM
  • i have tried it but not working
    Tuesday, November 10, 2009 10:59 AM
  • Hi varun,

    Just try some points

    1. First check Are you getting response from other JS on the form??

    2. Try to use only alert onchange event of the picklist.

    3. Try to clear you IE cache and then check.

    Hope it will help !!!

     


    Mahain
    Tuesday, November 10, 2009 1:34 PM
    Moderator
  • Try:

    In the entity.onload event, ONLY keep the below statement:

    crmForm.all.yourfield.onchange = function() {alert("x");}


    and enable it.

    Jim
    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com, http://mscrm.cn
    Tuesday, November 10, 2009 4:22 PM
    Moderator
  • I have seen similar issues before with bit fields when they are displayed as picklists. It depends on what type of bit field you use: checkbox, radio or picklist. OnChange for a checkbox gets fired as soon as the box is checked or unchecked, for radio buttons the OnChange was fired as soon as the radio was checked or unchanged AND the focus changed, and for picklist bit fields the OnChange event didn't fire at all.
    Tuesday, November 10, 2009 5:22 PM
    Moderator
  • i have tried all these steps...........i feel that the even is not at all fired on the onchange()

    can any one check this in there crm 

    check for the assign to picklist in the case entity
    Wednesday, November 11, 2009 6:50 AM
  • Hi Varun,

    I think assign to field is a custom field that you are using.

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    Wednesday, November 11, 2009 7:10 AM
  • it is not a custom field

    it is a crm system field
    Wednesday, November 11, 2009 7:17 AM
  • Hi,

    May i know the schema name of the field. Is it in Case entity?

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    Wednesday, November 11, 2009 7:55 AM
  • ownerid
    Wednesday, November 11, 2009 9:18 AM
  • Ownerid isn't a picklist, it's a lookup field. Do you need help with firing the OnChange event on a picklist or a lookup?

    • Marked as answer by Jim Glass Jr Thursday, November 12, 2009 5:25 PM
    Wednesday, November 11, 2009 10:41 AM
    Moderator
  • Hi Varun,

    Ownerid is a lookup field.

    The onchange script will work in case of new record only, it won't work for existing records.



    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    • Marked as answer by Jim Glass Jr Thursday, November 12, 2009 5:25 PM
    Wednesday, November 11, 2009 10:56 AM
  • owerid is Not a picklist, it's a special lookup mate. ;-(
    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com, http://mscrm.cn
    Wednesday, November 11, 2009 3:37 PM
    Moderator