Today’s guest blogger is Kris Pasterick, a Consultant at Sonoma Partners.
Recently, I came across some interesting behavior with Sub Grids and Option Sets in CRM 2013. The Sub Grid behavior is affected by the Field Requirement of the associated lookup fields. The length of an Option Set’s drop down is relative to the number of rows below it in a section. In order to explain the behavior, I have set up a simple scenario.
I created a custom entity called Role whose purpose is to track a Contact’s role at an Account. I created two lookup relationships from Role, one to Account and another to Contact. When I initially set this up, I created the lookup to Account as Business Required. However, I mistakenly left the Field Requirement on the lookup to Contact as Optional. While this certainly has an effect to the form for Role, it also affected the Role Sub Grids that I added to the Account and Contact forms.
On the Account form, the Role Sub Grid behaved exactly how I expected. Clicking on the plus (+) icon, pops open a new Role form with the Account filled in.
However, from the Contact form, if I click on the plus icon, a new Role form does not pop open, but rather a lookup field shows up in the grid.
The purpose of this lookup is to find that Role record to which you want to relate to this Contact. However, I wanted the same behavior as I had from the Account form. In order to fix this issue, I went back to the Contact lookup field and set the Field Requirement to Business Required. Once I published the changes, I started seeing a new Role form pop up when clicking the plus icon.
With this same Role entity, I had setup an option set field as the last field in a section, and when a user would click it to select a value, only three rows would display.
Elsewhere in the application that I was building, I noticed that a different Option Set would display more rows of options. What was different between these two Option Sets was that the other one was not in the last row of fields in its section. So I decided to add Spacers below the Option Set field. As I added more Spacers, more of the rows in the Option Set displayed. Through trial and error I found that the largest that an Option Set would appear was when there were 5 or more spacers or fields below the Option set within the same section.
So, if you want a larger Option Set drop down, add more rows below the Option Set in that section.