Personalized Community is here!
Quickly customize your community to find the content you seek.
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 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 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
I'm getting the exception: Object reference not set to an instance of an object, when trying to update an incident if I set a DateTime field (not required) through plugin code.
If I comment line below for the CloseDate, it works fine.
I can set it to null in SQL, but when trying to update the record through Excel, it throws same error as updating in the plugin code.
Not sure which could be the issue, it's very weird.
Again, field is not mandatory in CRM.
var entity = new Entity
LogicalName = Incident.EntityLogicalName,
Id = case.Id,
Attributes = new AttributeCollection()
Have you checked this sentence? Id = case.Id. May be case is null.
If you already retrive "case", why don't you update property directly?
case["new_closedate"] = null
What happens if you update with a real DateTime value? Like DateTime.UtcNow?
yes Id has value. I write its value to the trace. I only have the CaseID as (Guid), the case.Id in the code was to remove custom name.
When setting to utc now, it works
entity.Attributes.Add("new_closedate", (DateTime?) null);
Thanks, but same issue
But does the error come from this plugin you are showing to us? Because it seems that a different plugin or other process is trying to access that field and, since it's null, throws that error. Can you provide the error log, please?
Business Applications communities