locked
Limit number of records in CRM 2013 online RRS feed

  • Question

  • Hi,

       I want to limit the number of records that can be added for a specific entity (Custom entity ) in CRM 2013 online. I am trying to create a custom entity such that only 4 (for example) records can be added to it. Once the limit is exceeded it must no allow to open the form to add record. 

    Wednesday, September 10, 2014 7:35 PM

All replies

  • Hello Prithwiraj, One way to do this is to remove the default create button, add your own button. Use JavaScript to fetch count of records and show alert if there are more than 3 records and cancel event. You may have to create a plugin to cover this business rule when records are created using dataimport or when user can keep create form in 5 different ie window and create them together. Regards, Jithesh
    Wednesday, September 10, 2014 10:50 PM
  • You need to use a synchronous Plugin.

    Inside the plugin you will check how many records there are already for your custom entity, if the count reached your limit you throw an InvalidPluginExecutionException to advise the user about the limit and stop the creation of the record.


    My blog: www.crmanswers.net - Rockstar 365 Profile

    • Proposed as answer by HIMBAPModerator Thursday, September 11, 2014 4:53 AM
    Thursday, September 11, 2014 3:50 AM
  • Thanks, 

     I am pretty new to CRM Development, cane you please help with some resources that might help. Thanks

     

    Tuesday, September 16, 2014 8:35 PM
  • Hi,

    Please latest CRM SDK and look for sample code there.

    You can also check: http://msdn.microsoft.com/en-us/library/gg328490.aspx

    Apart from there are good videos available over yourtube for plugin development.




    Wednesday, September 17, 2014 5:29 AM
    Moderator