locked
CRM 2013: Pre-Update plugin interfering with form JS RRS feed

  • Question

  • I ran into something crazy today in CRM 2013, and I wondered if others had hit this. On the campaign activity form, there is js on the onchange event for the start/end dates, to make sure that start is before end. We have a pre-update plugin on campaign activity that can populate those fields. In CRM 2011, this was not a problem. In CRM 2013, if we make a change and save, that fires our pre-update plugin which will modify the dates on the target in the plugin context. The form is then refreshed with the updated dates... EXCEPT that it appears to sequentially process the target changes, so that the start date is updated first, before the end date, and is found to be later than the end date, and the JS throws an error. 
    Wednesday, April 30, 2014 8:31 PM

All replies

  • It does not necessarily process the dates sequentially.  In CRM 2013 there is an auto-save function that runs every 30 seconds.  It is thus possible for a user to update one date, have it auto-saved, then update the other (which may appear as though the dates were sequentially processed).  You will have to account for this possibility in your plugin and/or javascript.
    Friday, May 2, 2014 7:59 PM