Understanding Sub-Grid Functionality in Dynamics CRM 2015

Sub-Grids are an excellent way of displaying data related a record directly on the record form. In Dynamics CRM 2011, there were clear “Add New” and “Add Existing” buttons for each sub-grid so a user could determine how they wanted to associate something to the current record. With Dynamics CRM 2013, these buttons were both rolled into the singular “Add” button in the corner of each sub-grid:

Account Capture - Subgrid Button

This has caused confusion among legacy and new users alike, as the button does not have a consistent action across related records.

Sometimes the button will show a drop down menu which causes extra clicks:

Account Capture - Subgrid Sub Menu

Other times, the button will automatically create a new record. Why does the button act so strangely?

The secret to the mysterious “Add” button is simply the relationship between the two records at the field level:

1. If the lookup field on the child record is set to “Required,” the button will automatically create a new record.

2. If the lookup field is not set to “Required,” the button will ask you if you want to associate an existing record.

This is simply because setting the field to “Required” means that you are enforcing that relationship, and, theoretically, no record should have a blank parent field.

So, if you have a sub-grid you need to create a new record every time, simply find the child entity in your customization solution, find the lookup field that determines the parent record, and set the Field Requirement to “Business Required.” Likewise, if you want to be able to change the sub-grid to add existing records, set the field to “Optional.”

Field Create Capture - Field Requirement

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s