Data Grid “+” does either Add New or Add Existing
So, hypothetical situation, I need a data grid on a custom entity (call it Group) to allow me to add existing related records of Users.
Followed the steps as such:
- Go to User, add a new lookup field Group, and make it Business Required
- Go to the Group custom entity and add a data grid to Users
- Save and publish all customizations.
Now, the interesting behavior is that, once you navigate to Group, and click on the “+” sign to add a reference to a system user, you get prompted directly to create a new user. But that’s not what I want. I just want to associate an existing user to the Group.
Turns out that it matters a lot how you define the group lookup on the User form. Here’s how it works:
If the lookup to Group is defined as Business Required on the User form, then in the Group form data grid the “+” sign will create a New User record.
On the other hand, if the lookup to Group is defined as either Business Recommended or Not Required, then in the Group form data grid the “+” sign will open up a lookup field, allowing you to reference an existing User.
Just something to keep in mind when working with relationships.