Checking while inactivating record/records in DCRM 2011 RRS feed

  • Question

  • There is a scenario where when inactivating the record/records of the entity, i want to check that it has any active association with any other entity and if there is even one active association with the other entity i want to prohibit the user from inactivating that entity and also show a message to the user...Is there any out of the box functionality in DCRM 2011 for this..if not then how can we do it from customization..Thnx in advance
    Tuesday, June 7, 2011 9:13 AM


All replies

  • Some entities like "case" have this functionality built in, but for others (most of them) you would have to write a plugin that validates that when you deactivate a record.

    Gonzalo | gonzaloruizcrm.blogspot.com

    Tuesday, June 7, 2011 12:15 PM
  • Thnx Ruiz,

    Can I prompt the user about the same that "This entity record has some relation with other entity, so you can't inactivate the record" in Plug-in itself..Or i have to handle it separately in crm 2011..


    Tuesday, June 7, 2011 12:35 PM
  • You can prvoide any message to the user from the plugin. When your plugin finds that the there is a validation problem, you can throw an InvalidPluginExecutionException and you can provide the error message that will be displayed to the user (just pass the string in the constructor of the exception): http://technet.microsoft.com/en-us/library/microsoft.xrm.sdk.invalidpluginexecutionexception.invalidpluginexecutionexception.aspx

    Gonzalo | gonzaloruizcrm.blogspot.com

    Tuesday, June 7, 2011 12:48 PM
  • Hi Ruiz,

    I have a requirement of prompting the user that "This entity record has some relation with other entity, so you can't inactivate the record" which you said can be done with plugin..after this prompt i also have a requirement that i have to provide the user with feature that it can still inactive the particular entity record..in this prompt he would be shown list of related record of the entity as hyperlink..and provide him that he can inactivate the particular record from all this related record of other entity..can it be done in crm 2011 by plug-ins..


    Thanks in advance..:)

    Monday, June 13, 2011 10:31 AM
  • You might be able to write some advanced customizations to do so, but there is no out of the box customization that allows you to do that. You might want to post a new thread with your requirements to get visibility in the forum and use a title that reflects your new requirement

    Gonzalo | gonzaloruizcrm.blogspot.com

    Monday, June 13, 2011 11:57 AM