locked
MS CRM 2011 ONLINE - how to launch onChange event with a value from another onChange RRS feed

  • Question

  • How can I trigger a onChange event if the field value is set by another onChange even, not user?

    Friday, October 18, 2013 8:16 AM

Answers

All replies

  • Did you check ? : http://msdn.microsoft.com/en-us/library/gg334409.aspx#BKMK_fireOnChange

    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    • Marked as answer by crm-user-crm Friday, October 18, 2013 8:58 AM
    Friday, October 18, 2013 8:37 AM
  • Did you check ? : http://msdn.microsoft.com/en-us/library/gg334409.aspx#BKMK_fireOnChange

    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    Hmm, I think I have to tell more.

    I save "result" to the "new_trucknetto" field. The function is attached on another field, not in "new_trucknetto". So I save one field's value to another.

    var result = Xrm.Page.getAttribute('new_truck').getValue();

    Xrm.Page.getAttribute('new_trucknetto').setValue(result);

    Now there is also onChange event on the "new_trucknetto" field but it won't be triggered. If I manually set a value for "new_trucknetto" field, the onChange even will be triggered.

    Friday, October 18, 2013 8:46 AM
  • Did you check ? : http://msdn.microsoft.com/en-us/library/gg334409.aspx#BKMK_fireOnChange

    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !


    Okei, that worked! Thanks!
    Friday, October 18, 2013 8:58 AM
  • That should work :

    Xrm.Page.getAttribute('new_trucknetto').setValue(result);
    Xrm.Page.getAttribute("new_trucknetto").addOnChange(new_trucknetto_OnChange);
    Xrm.Page.getAttribute("new_trucknetto").fireOnChange();


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    • Proposed as answer by _Vikram Friday, October 18, 2013 9:00 AM
    Friday, October 18, 2013 8:59 AM