Maintaining a One-Of-A-Kind (OOAK) Record in CRM

Answered Maintaining a One-Of-A-Kind (OOAK) Record in CRM

  • Friday, May 25, 2012 12:40 AM
     
     

    We want to create an OOAK record in CRM in which to maintain several settings for our custom xRM Dynamics implementation.  There is obviously no problem creating the entity and fields.  The trick comes in making sure there is ALWAYS ONE and yet ONLY ONE of these records maintained in the system. 

    One idea I had was to disable or hide Ribbon Buttons for Delete, Save & New and Deactivate. This should work on the Entity form itself but I would still have to deal with New, Delete and Deativate buttons on the record section form (from which the Entity Form is launched).

    Any ideas on how to achieve this would be appreciated.

       

    • Edited by Kahuna2000 Friday, May 25, 2012 12:40 AM
    • Edited by Kahuna2000 Friday, May 25, 2012 12:42 AM
    •  

All Replies

  • Friday, May 25, 2012 12:57 AM
     
     Answered

    Kahuna2000,

    You can always create a plugin that registered on Post operation of Create, Update, Delete, SetState and SetStateDynamicEntity message to check how many records you've got left on the system after the operation took place.

    If the count is not 1, throw the exception which in turn will cancel out the operation.

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits

    • Marked As Answer by Kahuna2000 Friday, May 25, 2012 11:29 AM
    •  
  • Friday, May 25, 2012 1:11 AM
     
     Answered

    The Ribbon buttons in from Grids (Homepage Grids and Sub-Grids) can also be customised (including hiding).

    Dimaz proposed solution is the most "complete" as it will ensure that your OOAK requirement is adhered to, no matter what mechanism is used in attempts to invalidate it; it will, however, require .NET coding skills.


    --pogo (pat) @ pogo69.wordpress.com

    • Marked As Answer by Kahuna2000 Friday, May 25, 2012 11:29 AM
    •  
  • Friday, May 25, 2012 11:34 AM
     
     

    Thanks for the answers.  I think I probably should do both these things.  The button hiding will preclude users from thinking they can do something that will not be allowed by the system and the plugin will insure it even from imports, etc. 

    I will take a shot at the ribbons first as I have not written a plugin yet.  I have some C#.NET expertise so hopefully I can get there eventually.

    Thanks again.