In Dynamics 365, we can configure multiple forms for a single entity. For example, in Account form we have Information and Account forms and if you have installed Portal add-on, then you may also have Portal Account form. You can also configure users to be able to access multiple forms. When we have multiple forms, which form will the system show by default? If I switch the form, navigate away, and come back to view the same record, which form will get displayed? In this article, I will explore the behaviour of Dynamics 365 forms.
Configuring Form Order
To configure the default form order, navigate to Settings > Customization > Customise the system (ideally, you should make customisation using solutions). Expand Entities. In this example, I’ll configure Account entity’s forms. Expand Account entity. Click on Forms. Click on Form Order, drop down list and select Main Form Set.
Click on the Form you want to change the order of and click the green up and down arrows to configure the order. In my example, I am configuring the Portal Account form to be on the top of the list. This should get displayed when I open a record for the first time. Click OK. Click Publish All Customizations.
Explore Behaviour
Dynamics 365 make use of the HTML Local Storage. Data are stored locally to improve performance. Before I start the investigation, I cleared the cache and local storage. Click F12 in Chrome browser, click Application Tab. Click Clear Storage and Click Clear site data. I also clicked on the Session Storage and deleted all entries.
Navigate to Dynamics 365.
Let’s see what’s stored locally after we login.
Local Storage
Session Storage
Cookie
Let’s navigate to an Account record. As expected, the Portal Account form was shown.
Below are the Form IDs of two forms I would be using in this example.
1 2 |
Portal Account - F145C04D-9C36-417E-A9F8-5D61E0B09980 Information - B053A39A-041A-4356-ACEF-DDF00182762B |
Let’s have another peek at Local Storage. As you can see there’s a new entry called LocalStorageCache/EntityDefaultForm/account. The Portal Account form’s form ID is saved.
Let’s change the Form to Information and check the Local Storage again.
You’ll notice that the Form ID value of LocalStorageCache/EntityDefaultForm/account has not changed. But there are other variables which include the form ID of Information form.
Let’s navigate away from the form (I opened the Marketing Lists). When checking the Local Storage, I noticed the LocalStorageCache/EntityDefaultForm/account was still unchanged.
Open the same account record. As soon as I open the record, the LocalStorageCache/EntityDefaultForm/account value changed to Information Form’s form ID.
Now, even if I sign out, close the window, and sign in again, the Information form is displayed. The Last Used Form has become the default form.
The interesting thing here is that when I change the form, the value of LocalStorageCache/EntityDefaultForm/account didn’t change until I visited the form again. I decided to explore this further. In the Local Storage, every time a form is selected which was not selected before, a new entry is added.
1 2 3 |
1_f145c04d-9c36-417e-a9f8-5d61e0b09980_00000000-0000-0000-0000-000000000000_orgd64215ab 1_b053a39a-041a-4356-acef-ddf00182762b_00000000-0000-0000-0000-000000000000_orgd64215ab 1_00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000_orgd64215ab |
The 1_ in above entry represents the entity type code of Account entity. For Contact entity this would be 2_.
The f145c04d-9c36-417e-a9f8-5d61e0b09980 and b053a39a-041a-4356-acef-ddf00182762b in each entry are the form IDs.
The 1_00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000_orgd64215ab entry’s value changes when we change the form. The value includes the form ID of the form changed. Next time the form is loaded, the value of LocalStorageCache/EntityDefaultForm/account changes to the one last opened.
Legacy Form Rendering
Above scenarios were tested when Legacy Form Rendering is turned off.
When legacy form rendering is turned on, none of the entries I mentioned above are created. When I tested the same scenarios, the form always defaults back to the form defined on top of the form order. Last Used Form is not getting displayed.
Conclusion
To improve performance, new turbo forms system makes use of HTML5 Local Storage. Last used form’s ID of each entity is stored locally. Storage is not session based and even if the user logout and login again, correct form will be displayed. When Legacy Form Rendering is turned on, the entries in Local Storage are not used and the default for is always displayed.
Thank you for visiting Dyn365Apps.com.
Follow me on Twitter to get the latest news, tips and tricks and more …
Until next time…