locked
Prevent fireonchange from firing a onchange script RRS feed

  • Question

  • Hi,

    I have a method (showConfirmation()) written on onchange event of field new_test (optionset).

    Also, there is a method in onload which calls fireonchange() for field new_test due to which the confirmation window is being displayed in Onload also which should not happen.

    How do I fix this issue.

    My script is on mscrm2011.

    I have tried by passing executioncontext , setting any global flag value and also removeonchange() method none of which works..!!!

    Thanks !

    Uma

    Saturday, May 20, 2017 12:09 PM

All replies

  • I think you'll need to restructure your code. One way is to:

    • Move the code from the onchange event of field new_test into a function that takes a boolean parameter, and use it to control whether to call the showConfirmation method
    • Call the new function from the onchange event, and from onload, passing the appropriate value to the boolean parameter

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Saturday, May 20, 2017 2:41 PM
    Moderator
  • I have fix this issue in Dynamics365 using removeonchange.

    Removeonchange should be called before changing the field.


    Regards Faisal

    Monday, May 22, 2017 1:42 PM