locked
CRM 2011 Single Instance of a Custom Entity Type - Is there a way to enforce this? RRS feed

  • Question

  • I have a Custom Entity that I only want to allow one instance of. Is this possible? Or should I be looking to use another construct in CRM?
    Tuesday, May 17, 2011 7:32 AM

Answers

  • I was talking my boss through this just today.

    The easy way is to create a restrict Delete/Create permissions to Sys Admin role only.  Create your single instance and it will remain the one and only as long as someone with Sys Admin privileges doesn't do something silly.

    To ensure that you have only a single entity instance, you'd have to write a plugin to handle the Create/Delete messages.


    --pogo (pat) @ pogo69.wordpress.com
    Tuesday, May 17, 2011 8:52 AM
  • You can modify the sitemap so that when you click on the custom entity on the navigatio nmenu, you get the actual entity form of your unique instance in the right (instead of getting a grid), you can also hide the "new" and "save and new" buttons from the ribbon.

     

    However, the only thing that can guarantee uniqueness is a validation plugin.

    Tuesday, May 17, 2011 1:32 PM
    Moderator

All replies

  • Can you explain the business scenario please?
    Linkedin : http://in.linkedin.com/in/rammscrm/
    Tuesday, May 17, 2011 8:12 AM
  • I was talking my boss through this just today.

    The easy way is to create a restrict Delete/Create permissions to Sys Admin role only.  Create your single instance and it will remain the one and only as long as someone with Sys Admin privileges doesn't do something silly.

    To ensure that you have only a single entity instance, you'd have to write a plugin to handle the Create/Delete messages.


    --pogo (pat) @ pogo69.wordpress.com
    Tuesday, May 17, 2011 8:52 AM
  • You can modify the sitemap so that when you click on the custom entity on the navigatio nmenu, you get the actual entity form of your unique instance in the right (instead of getting a grid), you can also hide the "new" and "save and new" buttons from the ribbon.

     

    However, the only thing that can guarantee uniqueness is a validation plugin.

    Tuesday, May 17, 2011 1:32 PM
    Moderator
  • Ramasubramanian - Business scenario is that I have an 'Industry Representative Group' Custom Entity. There will only ever be one Industry Group so I don't want to allow Users to create more than one instance.

    Pogo69 & Gonzalo - Thanks a lot for your responses, both make sense and perhaps both can be implemented to some degree. I think I'll confine Create/Delete permissions to Sys Admin so that a broader group of Users can still maintain the data in the singleton entity. I'll also modify the Nav menu, that's a pretty neat trick too. And if I create a validation plugin as well, that should cover everything. I'll have a go at implementing all of these, probably the first two I can do now, the plugin will take a bit more time. Thank you.

    Tuesday, May 17, 2011 11:37 PM