Tip #714: Avoid solution bloat with the new solution component framework

Bloat fishAdam “you say gotcha, I say undocumented feature” Vero has the microphone.

The ability to add individual components to a Solution in 2016 is great, with or without the formal patch clone, update and rollup features.

You can add just the things that you are actually changing to deliver the requirements for a sprint, or a bug fix, or an individual user story and keep your solution lean and mean. This makes any unwanted interactions or overlap between solutions easier to predict and avoid, and makes it much clearer when looking at a Solution exactly what components it is changing.

That’s not the tip! (hopefully readers of CRM Tip of the Day already know most of that).

The tip is to avoid a gotcha that reduces the benefit of this new model. Say you create a new custom entity in your solution. Like most entities, to do useful things it needs relationships to other entities, often big things like Account, Contact, Opportunity, Case and so on. When you create a new relationship from an entity to any other entity that is not already in the solution, the system very “helpfully” adds the target entity (parent or child) to your solution just in case you want to work with it later. No prompt, no confirmation dialog box – it does not handle this like it does for offering to include dependency components. It just silently adds the whole of a huge OOB entity that you are not modifying in any way at all (or at least not yet), along with all of its subcomponents. As always, this might include untested or incomplete changes made by someone else which you then unwittingly ship with your Solution.

So how to stop this happening? Stay one step ahead. Before you create the relationship, add the target entity to your Solution and select only the components you will be modifying (if any). If you are creating a 1:N relationship, you might want one or more forms of the “child” entity so you can add the new lookup field to them, or even a Quick View form. Perhaps you need one or more views so you can add a column for this field too (especially lookup entities such as Country, Category…). If you are creating a N:1 relationship you might want the forms of the “parent” so you can add a sub-grid for the new child entity, or at least navigation pane links. But apart from the things that you are expecting to modify, don’t add anything now. If unsure, add nothing at all except the entity itself (not even metadata) – you can always add subcomponents later.
When you create your relationship, the system sees the target entity is already in the system and does nothing unhelpful to bloat your Solution.

If you have been caught out by this already, you can of course remove the entity from your Solution, then re-add it by hand and be more selective. In some cases you might not need to change anything about the target entity, in which you don’t need it in your Solution at all – subject to usual dependency checks of course, in other words you know it will already be in the target system you are deploying to.

Tweet about this on TwitterShare on Facebook2Share on Google+1

Leave a Reply

Your email address will not be published. Required fields are marked *