Blog, CRM Extensions

How to use Xrm.Utility.getResourceString in Html WebResources

I saw several threads on community forums that state “Xrm.Utility.getResourceString” functionality doesn’t work in Html webresources. I decided to spend some time digging to find out why it doesn’t work and how to make it work.

During investigation I found out that Html window missed several objects that were available on regular entity form. Unfortunately I was not able to find easy way to create those object so I composed solution that composes and initiates all the required objects on the form. Here is what should be done to make “Xrm.Utility.getResourceString” work again:

  • add following code to your code before using “Xrm.Utility.getResourceString”. As a parameter for AB.HtmlLocalization.Initialize I pass an array of JavaScript that have “Resx” dependent webresources. It builds required structure of objects in window and returns promise.

This is the first release of the product and I haven’t done massive testing so if you found a bug or have suggestions feel free to leave your comment here or open an issue on the GitHub repository.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.