web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to update one of two subgrid with thesame regardingId on a form

(0) ShareShare
ReportReport
Posted on by 410

 I have two subgrids(the same child entity) on a form, I am meant to update  one subgrid programmatically and not the other. I know i need to retrive the regardingId and update the regarding, but like i said, I want to just update one of the subgrid and not the other. The code i have written updates all the subgrid because they all have same regardingid and it being thesame entity. Is there anyway i can tell the dynamics API to update only the records in one subgrid and not the other?

*This post is locked for comments

I have the same question (0)
  • chikhaleankush Profile Picture
    547 on at

    Let me understand your questions, When you mean update subgrid, you indirectly mean Record from that subgrid right? i.e either you create new record or you update existing one.

    Now when you have 2 subgrid of same Entity, You have choice to show different view in these 2 subgrid.

    Let's take an example:

    Main Entity Account has 2 subgrid for Contact.

    Now you can keep 1 subgrid for Contact as "Active Contacts" and 2nd subsided as "Inactive Contacts"

    What will happen is that those 2 sub grid point to same contact entity but shows different record.

    But if you have same view on both sub grid irrespective of where you update if they show same records, it will be updated/refreshed.

    I believe this helps.

  • Victor Onyebuchi Profile Picture
    410 on at

    chikhaleankush what i meant is, i have written a code that, on the click of a button(two option), i want to update a field of all the child records on one subgrid and not the other. The code i have written get the regardingid of the child record that equals the parent record (in your example the Main Account) and update the field i want, but it is also updating the second subgrid, because its regardingid is also the Main account. I hope you understand now. So what i want is how to tell dynamic Api using code to not update the second subgrid only the first one?

  • Verified answer
    chikhaleankush Profile Picture
    547 on at

    I believe I understand.

    As you have 2 sub grids of same entity, obviously they will have same regarding.

    Now I want to know how can we (You) as developer differentiate records from grid 1 and gird 2.

    As mentioned previous in my answer there might be some special criteria like active contacts or inactive contacts.

    If we know the difference we can restrict update only few records.

    Again ex: subgrid 1 has 5 records subgrid 2 has 6 records. ( I assume all there 11 records are unique i.e they are not same, they have unique Guid)

    Currently your code updated 11 records but you want only 5 to be updated. Once we know the criteria we can restrict to no update those rest 6 records.

  • Victor Onyebuchi Profile Picture
    410 on at

    chikhaleankush Certaining there is, there views in the subgrids are filtered diferently. Thanks for the heads up.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
NeerajPawar Profile Picture

NeerajPawar 2

#2
jlattimer Profile Picture

jlattimer 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans