Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
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?
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.
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?
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.
chikhaleankush Certaining there is, there views in the subgrids are filtered diferently. Thanks for the heads up.
Business Applications communities