Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Cannot Add New Record to Subgrid in Contact Form

Posted on by Microsoft Employee

Hello,

I have created 4 custom entities, one each for Type, Category, Tag, and the fourth holds the selected values (lookup fields) from each of the three entities (Attributes).

These entities are dependent on each other. I have created a form for the Attributes that uses lookups to the three other entities to populate the fields. It all works fine so far: I can select a type, and when I go to select a Category, only the Categories that correspond to the given type are displayed. This is also true for selecting Tags, where only the Tags that correspond to the selected Category are displayed.

This all works fine and is very cool. Now, I want to add these attributes to the Contact records. So, I created an N:N relationship between Contact and Attributes, which seems to be ok.

I then placed a sub-grid on the Contact form which has the lookup fields from the three entities and I verified that it functions stand-alone to add records and configured it to display related records only.

Now, I go to update a Contact record.  There are no Attributes yet for this contact, so I click on the little "+" sign to the right of the sub-grid, but nothing happens. I then added one record to the Attributes, but when I edit a Contact, now the "+" sign only allows me to select the existing record from Attributes but it does not allow me to add one.

How do I configure the form or relationship to allow the user to add records to the sub-grid? I have seen articles where they say something must be required (a field maybe?) for the form to allow the addition of new records in the sub-grid.

I am very good at SQL, VB, C# and JavaScript, and if I had to do this in .NET it would take me maybe an hour. I have been trying to figure this out for the better part of a week in CRM.

Any help or suggestions would be very much appreciated.

I am on CRM on-line (2016?).

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot Add New Record to Subgrid in Contact Form

    1.  Make sure you are referncing the correct view in the subgrid if you have more thn one relationship between Contacts and Attributes.

    2. "I am very good at SQL, VB, C# and JavaScript,"

    If all else fails, you are not bound to 3NF with this Kimball lifecycle stuff. If you really have to, you can hard bind the child record to it by using a lookup on the 'attributes' form linking to the 'contact' entity which will under the hood create a new 1:N relationship (Contact:Attributes) which should then make the record visible in the subgrid. You can use field mappings or an oncreate workflow to populate the contact lookup and make it invisbible on the form if you like. Field mapping wil populate it before create, workflow after create.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot Add New Record to Subgrid in Contact Form

    Hello Gopalan,

    I have a situation where the N:N association was created when adding a new record through a subgrid.  But is has stopped working as expected (as you described).  The new record is created but the association between the originating record and the new record is not created thus the new record is not displayed in the subgrid.  I attempted to add an associated record from the list originating record's list view screen but received the same result.  Any ideas of why the expected behaviour would stop working and how to correct it?


    Thanks,

    Dianne

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: Cannot Add New Record to Subgrid in Contact Form

    Contact Entity and Attribute entity have N:N relationship.

    You have a SubGrid for Attribute entity in Contact entity Form.

    If you click + you would be shown search. You can select one of the Attribute records.

    If you want to associate with a new record you can click the + New button at the bottom of the search box

    After you creating it, the newly created record should be displayed in the subgrid automatically.

    This is the expected behaviour. You are not achieving this? or You do not like this default behaviour?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot Add New Record to Subgrid in Contact Form

    Yes, I can create a new Attribute record this way, but, it pops a new window, and does not associate the new record with the current Contact record. Once the new record is created, I have to go back to the Contact form to search for and select the new record. Horribly inefficient. The client is not going to accept that at all.

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: Cannot Add New Record to Subgrid in Contact Form

    Hi

    When we have N:N relationship, by default it would show the search window.

    If you do not want to add from the existing records, you can find out a within the search window.

    You can use this to create a new record.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans