CRM 2011-Override Ribbon RRS feed

  • Question

  • Hi,

    I have to do some form validation on Click of "Mark As Complete" button on activity. If everything loooks fine then only Mark as Complete functionality should work else it should throw alert message.

    I am showing alert message if form is not validated but how to stop it from marking the activity completed.


    Friday, June 21, 2013 5:50 AM

All replies

  • You can cancel the fired event by calling Xrm.Page.context.getEventArgs().preventDefault(); within you validation code. For more info, check the MSDN reference - msdn.microsoft.com/en-us/library/gg509060.aspx

    Hope that helps,

    Rick Gipson

    Friday, June 21, 2013 6:04 AM
  • Hi,

    You have to overwrite the "Mark as Complete" functionality. Check this link


    and add your <EnableRule>.You can add <CustomRule> where you can validate the functionality in javaScript function.Disable Ribbon button if the criteria does not fullfill.

    Hope this 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

    Friday, June 21, 2013 7:34 AM