locked
Form is saving on load in MS CRM 2013 ONLINE RRS feed

  • Question

  • Hello.. 

    We are recently upgraded from CRM 2011 to MS CRM 2013 online. We are noticing a strange behavior in CRM forms, the form is Saving when it loads. tested it by adding a alert in save, it triggers while page loads. Auto save has been disabled and we have Save button on every form. 

    This is happening in lead and opportunities, we have several plugins  on Update message in these two entities. here is the screen shot  from audit history of an opportunity form. 

    And another point here is , CRM 2013 has become very slow, especially  lead n opportunities  when it loads. not sure it is only for us  or every one who as upgraded have this issue.




    • Edited by Pradeep47 Friday, January 10, 2014 7:02 AM
    Friday, January 10, 2014 7:00 AM

All replies

  • You obviously have a plugin performing an update when the form loads.  Are you generating some sort of tracking/record number for the record to display on the form?  Just a hunch, since someone may want to save the record with the tracking/record number before another user created a record at the same time with a duplicate number.

    For loading performance, you may want to look at what tabs are loading and only initially load what is necessary.  If you have a lot of on-load script, you may want to look at that also.  You can use fiddler while loading the form to get times of how long each call is taking and determine if it is custom code, etc.

     

    Jason Peterson

    Friday, January 10, 2014 9:27 AM
  • No we don't have any tracking number.but we have auto-generating opportunity number plugin which triggers on Create.

    We have plugins on Update, Qualify, GranAccess(toshare),Win,Create etc messages but no plugin is performing on Form load action. 

    I checked on load java scripts, yes we do have some javascripts , I disabled all the java scripts on load and tested , still save is triggered on load.

    I tried checking for auto save using  execObj.getEventArgs().getSaveMode() == 70 !! l !! learn that this is not an Auto-save action this is  looks like manul save from code or plugin !! also tried checking for form .getDirty()  still no use..

    Please do note that we we were not having this issue in 2011 online this is happening after the upgrade. till then everything was working fine. we have not added any new plugins/javascripts  after the upgrade 

    I look into fiddler to to improve the load performance.. 

    Thank you. 

    Friday, January 10, 2014 10:51 AM
  • Please check if there is no JS code that is explicitly causing the save.
    Friday, January 10, 2014 11:44 AM
  • Please check if there is no JS code that is explicitly causing the save.
      Exactly.. this  was my first assumption. checked every JS we are not calling Save explicitly in any of the code.. :(
    Friday, January 10, 2014 12:00 PM
  • Pradeep in this case the ideal practice would be:

    Remove all the JS on that Entity. Then check if it happens. If yes- Deregister the plugins operating on that entity. These should do the thing for you. Keep us posted.

    Friday, January 10, 2014 12:07 PM
  • Pradeep in this case the ideal practice would be:

    Remove all the JS on that Entity. Then check if it happens. If yes- Deregister the plugins operating on that entity. These should do the thing for you. Keep us posted.

    After going through all the plugin codes line by line.. found t his one..  in a plugin which is register under Update message.

           
                     if (needToUpdate)
                     {
                        service.Update(entity);
                     };

    Question is,  if the plugin is registered under Update message is there a need to call service.Update inside the code ??

    Tuesday, January 14, 2014 6:26 AM
  • Hi,

    This depends on what it is trying to update, and whether the plugin runs in post operation.


    Ronald


    • Edited by Ronald Liu Tuesday, January 14, 2014 7:14 AM
    Tuesday, January 14, 2014 7:12 AM
  • Yes it runs in post operation also added PostImage.. updating few fields after checking certain condition,. 


    • Edited by Pradeep47 Tuesday, January 14, 2014 7:27 AM
    Tuesday, January 14, 2014 7:26 AM
  • Then there is a reason for it to call Update. Do you have Business Process Flow enabled for the entity form? The three updated field seen to be of that nature.

    Ronald


    • Edited by Ronald Liu Tuesday, January 14, 2014 7:48 AM
    Tuesday, January 14, 2014 7:40 AM
  • Then there is a reason for it to call Update. Do you have Business Process Flow enabled for the entity form? The three updated field seen to be of that nature.

    Ronald


    Yes..  we have business Process flow enabled for the lead and opportunity entity.  

    Please note, we were using the same plugin in MS CRM 2011 online without any issue it was not having any issue at that time. after that upgrade we are having this save issue on load of the form.. 


    • Edited by Pradeep47 Tuesday, January 14, 2014 8:37 AM
    Tuesday, January 14, 2014 8:36 AM
  • This is strange..  Just out of curiosity I disabled Business process flow(had only default one), now the form is not saving on load. !!!!! Now I see that Business process flow in Lead and Opportunity is the culprit !! 

    What causing Business process flow to save(or triggers the plugins on update message)on form load in CRM 2013 Online. can some one pls explain me this ?!!

     

    • Edited by Pradeep47 Tuesday, January 14, 2014 11:40 AM
    Tuesday, January 14, 2014 11:24 AM
  • Hi,

    That is just the nature of the beast. With the introduction of BPF in CRM 2013 any participating entity would have its records updated with BPF related attributes by CRM. 

    "Before you can include an entity in a Business Process Flow, you must configure the entity to enable the Business process flows property, and then save and publish the entity. When you do this, the system will add two lookup fields to the entity that are named Process Id and Stage Id. These fields store the current process and the stage for a record, and this lets the user continue a process from where the process stopped. You cannot modify these fields, add these fields to a form or use these fields in Workflow or Dialog processes. You can include these system fields in queries for a view or Advanced Find. If you add the Process Id or Stage Id as columns in a view, the process and stage GUIDs are displayed, not the names. Therefore, adding these fields as columns is less useful than including the fields in the query definition."

    If your plugins are triggered by this or the auto-save feature you should follow the following best practice: 

    "It is a best practice to register your plug-in or workflow on entities and specific fields that matter most. Avoid registering a plug-in or workflow for changes to all entity fields. If you have an existing plug-or workflow that was implemented before the availability of the auto save feature, you should re-test that code to verify its proper operation. For more information see the customization guide topic Manage auto-save."


    Ronald

    Tuesday, January 14, 2014 5:22 PM
  • If this is this the nature of  the beast, then I would say beast has gone insane.. 

    This is not only about triggering plugins on save, this is this about triggering Save action on load, this will make this form to load very slowl coz as soon as it finish loading it starts saving the whole form. hence user can notice the delay.  Is there any other workaround to avoid this save on load ?!!!

    Not sure it matters. but we are still using our old form "information" (from customization) not the form named "lead" in CRM 2013. we haven't decided on the new design of the form so we haven not activated/merged with new form. 

    Thanks Ronald for giving me an insight about the issue.  




    • Edited by Pradeep47 Wednesday, January 15, 2014 1:35 PM
    Wednesday, January 15, 2014 1:27 PM
  • Any one else facing same issue ??
    Thursday, January 16, 2014 10:24 AM