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 1Discover 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 TimelineWatch the 2020 Release Wave 1 virtual launch event
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
My problem is that I can't follow what happens. After a plugin tries to update an entity it crashes with the following error "Index was out of range. Must be non-negative and less than the size of the collection." don't think it is important what the error message is but I want to know if there is any good way of following this code. Since I don't know what things triggers on this entity update. I want to find where is error occurrs.Thanks in advance
If you have access to the source code and symbols, you can debug CRM Plug-ins by either using the Plug-in Profiler (both Online and OnPrem) or by attaching Visual Studio directly to the process running the plug-in (OnPremise Only)
Please find following articles that describe how you can debug the plug-ins:
Do you have any trace log written in your plugin ? I would suggest to write some trace log or debug the plugin first to get which line the plugin is giving error. Its something the value which you are retrieving is not valid code. Lets have an example like you have an array of length 5 now if you want to retrieve 8th element so its simply return out of range.
Please check below references for tracing in plugins -
Hope this helps.
If you can share your plugin code then we can suggest some recommendations. In general this error occurs is not related to the update but related to how you are retrieving the details and how you are handling the object i.e. if you are putting a proper check or not. Consider the you are using this statement to retrieve multiple entity records "var results = service.RetrieveMultiple(new FetchExpression(fetchXml));".
now without checking if the results is null or if it actualy contains any records, you try to access the object i.e. results.Entities, not if there are no records than you get the error in your questions.
to avoid this, you need to check if results != null && results.Entities.Count >0
I will try the plugin profiler!
I am logging like a crazy person but I can't really find where to place logs.
Business Applications communities