Today's blog post was written by Matt Dearing, Principal Developer at Sonoma Partners.
I had a customer reach out recently saying they were trying to open contact records from one of their sandbox Dynamics 2016 online instances and were getting the following popup:
The log file showed the following:
"systemform With Id = 04238d8a-dbf8-467c-805f-4af4b757870 Does Not Exist"
I asked the user if they had deleted any forms recently. They said they had deleted a secondary "test" form in that org. My thought was that something had cached that old form id and CRM was continuing to try and load it even though it no longer existed. I asked the user to clear their browser cache, but they still received the same error. I asked them to try and load the same record in a secondary browser while I went ahead and queried "userentityuisettings.lastviewedformxml" via a fetch xml query and noticed that the old form's id was still there.
|lastviewedformxml||<MRUForm><Form Type="Main" Id="04238d8a-dbf8-467c-805f-4af4b757870f" /></MRUForm>|
I did a "publish all" and queried again and saw that the correct form id was now stored.
|lastviewedformxml||<MRUForm><Form Type="Main" Id="1fed44d1-ae68-4a41-bd2b-f13acac4acfa" /></MRUForm>|
Which meant the publish all may have triggered a refresh, or it was a coincidence and what actually refreshed "lastviewedformxml" was the user's secondary browser. Either way I asked the user to try again in the primary browser, expecting everything to work, but they still received the same error. I navigated to the same record, which loaded fine, so I decided to take a quick look at local storage via the dev tools. I noticed form ids were cached there.
I had the user run "localStorage.clear()" from the console window of the dev tools instance on their primary browser, then reload the page and everything loaded correctly.Although the user had cleared their cache it appears some browsers tie local storage to clearing cookies, so depending on what your cache clear is actually doing, it may not be clearing local storage.
The need for deleting a form rarely arises, but if you find yourself in a similar situation be very careful. If the form must be deleted and users have been using it, you may need them to fully clear their browser cache in order to get the correct form loaded.