locked
CRM 2015 - JavaScript Save function does not fire. RRS feed

  • Question

  • Working with a CRM which has been upgraded from 2011, through 2013 into 2015.

    There is an onChange event of the firstname and lastname fields do a check and then force a save.

    I can see that the JS code block is being hit but the save function has no effect??

    Xrm.Page.data.entity.save();

    Any ideas about what might be causing this?

    I am not seeing a pop up error.  It just seems that the function fires but does nothing.

    Autosave is turned on.

    Friday, October 2, 2015 2:13 PM

Answers

  • Aha!

    Once I made the firstname, lastname and composite visible on the form I could see that there is an error which pops up next to the little save button and says that fullname must be populated.

    I can fix the issue by hanging the event off fullname rather than firstname and lastname.PArtly caused by the fact this was 201a and built for firstname and lastname and also partly caused by the fact that the fullname getting populated seems to happen later in the pipeline than the firstname/lastname onchange event.

    The validation error only occurred visibly on screen after I made all name fields visible,

    Friday, October 2, 2015 2:46 PM