This project has moved and is read-only. For the latest updates, please go here.

Ability to Filter Entities

Apr 17, 2014 at 3:30 PM
Great tool, it's just missing the ability to filter entities.
Apr 18, 2014 at 1:24 AM
So rather than generating all entities, you'd like to be able to skip some?
Apr 21, 2014 at 4:40 PM
Edited Apr 21, 2014 at 4:41 PM
Yes. This is common to help reduce the footprint of a plugin. In a highly customized environment, I have seen the early bound class be well over 3mb. If you filter down to the 5 entities that you need for that plugin, the class will be around 300kb.


For the UI, I am thinking a list of entities with check boxes and one checkbox at the top to select/deselect all. By default you can have them all selected. Also, the trick to this would to also filter out the optionsets for the unwanted entities without having to define the individual option sets (when generating the optionset class)


Here's some code that I found (and used) to do the filtering. http://erikpool.blogspot.com/2011/03/filtering-generated-entities-with.html.






PS: This is a nifty little piece of code as well: https://crmsvcutilgenerateattributeconstants.codeplex.com/. saves some headaches when using queryexpressions or retrieving only certain columns.
Apr 22, 2014 at 7:04 PM
Edited Apr 24, 2014 at 7:29 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.

UPDATE:
Work Item has been completed. Feature now included.
Marked as answer by hulk2484 on 4/24/2014 at 11:29 AM
Apr 22, 2014 at 7:19 PM
Great, I'll give that a try as well.
Apr 24, 2014 at 7:28 PM
spride wrote:
PS: This is a nifty little piece of code as well: https://crmsvcutilgenerateattributeconstants.codeplex.com/. saves some headaches when using queryexpressions or retrieving only certain columns.
If you're using QueryExpressions, Why? You should also check out the Extension methods in DLaB.Xrm.Extensions. It has a ton of helper methods on IOrganizationService that make your life easier when working with QE's
Apr 24, 2014 at 7:40 PM
The only time I really use QE's anymore is when I need to work with more than 5000 rows in memory (verrrrrry rare), or when dealing with old code that I don't have the time to do a full linq conversion on. Just thought it would be a nice little feature to have beings the code exists already.
Apr 24, 2014 at 9:27 PM
Edited Apr 28, 2014 at 4:04 PM
The code can never be used just as is, since I've got to add the configuration on the front end and the read the configuration from plugin side. There is nothing stopping you from creating your own plugins that do whatever you want to do, then call my plugins afterwords. All the configuration is in the Xml Settings files.

I don't see that as being used a whole lot, but feel free to create a separate discussion, and if multiple people request it, I'll add it.