AndrewButenko / ABDialogs

MIT License
12 stars 0 forks source link

Offline Mode support #6

Open marufdolani opened 3 years ago

marufdolani commented 3 years ago

Does not support offline mode. It looks like the dependencies are loaded from CDNs. It would be nice to add dependencies bundled to ensure it works in offline mode with the D365 Mobile App.

AndrewButenko commented 3 years ago

Hello Maruf, thanks for trying it. Do you have any ideas what dependencies are missing? Or dialog just silently dies?

marufdolani commented 3 years ago

Not sure how to find that on the Tablet app. The dialog opens but with no content inside with the message "No data available".

AndrewButenko commented 3 years ago

Was it "No data available" or "Data Parameter was not passed"?

marufdolani commented 3 years ago

The message says "No data available." I used the sample code that you posted. No change to that.

AndrewButenko commented 3 years ago

@marufdolani it seems that this is how it works without any additional changes. Check the very last point from Nishant from his post about online/offline comparison - https://nishantrana.me/2020/05/14/notes-on-dynamics-365-for-phones-and-tablets-app-part-11-mobile-offline-capabilities-and-limitations/

This made me think though - when the webresource is embedded into the form - it works, so there is a chance that there is an alternative URL that points to the local storage where everything is stored and when the app is in offline mode - this alternative URL should be used.

marufdolani commented 3 years ago

@AndrewButenko Very interesting. Did you update the Managed Solution with the webresources marked as available offline? If the webresource is marked for offline availability, I would like to test with just the offline checkbox checked and not dropping the webresource on a form.

CRM should really do the translation between the webresource url and the offline local storage url or load the appropriate file for the localStorage object cache. Let me know when you need me to test.

AndrewButenko commented 3 years ago

@marufdolani I marked html webresource as availalble for online from the very beginning. I believe when app works in offline mode it uses some other URL and Xrm.Navigation.navigateTo doesn't use the same approach as the form embedded HTML webresource uses. My plan is to get the URL used by the embedded HTML webresource and use a similar approach for Xrm.Navigation.navigateTo.

marufdolani commented 3 years ago

Thanks @AndrewButenko. This does seems like a bug that Microsoft should fix as well so they have consistency and their exposed APIs call their internal API/methods.