locked
if user continuously click on Save button in mscrm 2013 my custom action fire's multiple time in Chrome browser RRS feed

  • Question

  •  i am disabled  auto save functionality for all entity in my  crm2013 org, so i can able to view save and save&Close button's at left  corner side 

     i wrote an Custom action which is triggering by java script method , i added this method in form save event

    now if i click on continuously save button (which is available at top left corner ) in chrome browser ,my custom action is triggering multiple time 

    i want to restrict that to only one time( suppose if user click on double click on save button it should trigger only one time) 

    cloud any one please help me, it should work in chrome also

    Thank's in Advance 


    • Edited by pavad Thursday, November 6, 2014 10:36 AM
    Thursday, November 6, 2014 10:13 AM

All replies

  • Hi,

    You can restrict your code to execute one time.

    1.Create one custom field say IsRecordSaved type two option (default false).

    2.Place the Field on the Form.

    3.In your Form Save event  JS add below logic

    4.

    if(Xrm.Page.getAttribute("IsRecordSaved").getValue() == false)
    {
      //Call your Custom action Javascript method.
      
       Xrm.Page.getAttribute("IsRecordSaved").setValue(true);
    
    }
    else{
       //Do Nothing
    }
    Hope it helps,



    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in


    Thursday, November 6, 2014 6:38 PM