locked
Change the custom field OptionSet value on reactivate case button from ribbon. RRS feed

  • General discussion

  • Hi,

    I have a requirement that, if the case entity reactivate button on the ribbon is clicked then i need to change the custom fields optioset value.
    adding web resource to existing system item on ribbon is what i thought would do but am not sure if thats the approach that needs to be taken or a plugin. 
    Any guidance or code that will be able to accomplish this task will be appreciated.

    Thanks
    Gary

    Wednesday, August 21, 2013 4:46 PM

All replies

  • Hi Gary,

    We can override the system fields and can call the Web Resource JavaScript on click of button, But I am not sure it will work or not. Because on click of button we can call the JavaScript Function that will set the custom field but CRM 2011 Internal functionality may activate and refresh the record before the setting custom field is performed.

    http://sujithoncrm.blogspot.in/2012/10/how-to-override-or-hijack-system-button.html

    You should go with Plugin. Register your plugin on SetStateRequest.

    Hope this helps!

    Thanks!

    Wednesday, August 21, 2013 5:46 PM
  • Hey Kalim,

    Thanks for the piece of advice. I would go with plugin i guess, do you know on how to instantiate the plugin since the plugin should trigger when you click the reactivate case button on the ribbon.

    Gary

    Wednesday, August 21, 2013 6:50 PM
  • Hi Gary,

    Why not just use a workflow that gets triggered on the Case Status change?

    The workflow can update the custom field value.

    Thursday, August 22, 2013 1:38 AM
  • Sunil,

    Well i need to trigger it from the ribbon button (reactivate case). this should change the option set value. Not from the case status alone.

    Guess the plugin is right option but not sure how to trigger from ribbon button.

    Gary

    Thursday, August 22, 2013 3:19 AM
  • Hi Gary,

    As stated in my earlier reply when we click the Reactivate button the SetStateRequest fires. So we have to register Plugin On SetstateRequest.

    If you don't have complex logic to set the fields value. You can create a Process that will fire on status change.

    You can put the If or Until condition for Active status as given below and update the custom field.

    Hope this helps!

    Thanks!


    • Edited by Kalim Khan Thursday, August 22, 2013 4:44 AM
    Thursday, August 22, 2013 4:44 AM