Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Javascript/Typescript script for Command button can't find resources file with text strings in Model-driven app

(0) ShareShare
ReportReport
Posted on by 53

Hello everyone

I have written a Typescript script for a custom command button in the ribbon of a Model-driven app. The button is for the main form of a custom entity named Project.
In this typescript script, I want to access some string data in a resource file.

Resource file looks like:
pastedimage1673960938290v1.png
The file is called eri_strings/eri_scripts.1033.resx

The resource file is added to the solution.

I call this resource file like this:

pastedimage1673960988637v2.png 

However, when I run the script, I get the following error:

pastedimage1673961077610v3.png

The script in the button can't find the resource file.
However, that same resource file is also called in the script of the Account Main Form, using the same code, and there, the file is found. 

Does anyone know why my file isn't found on the command button script, but it is found with the main form of the Account entity?

Any ideas would be much appreciated!

Thanks in advance!

  • Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Javascript/Typescript script for Command button can't find resources file with text strings in Model-driven app

    Great. Good to hear that you found the solution

  • Suggested answer
    Junius01 Profile Picture
    Junius01 53 on at
    RE: Javascript/Typescript script for Command button can't find resources file with text strings in Model-driven app

    I found out I need to add a dependency to my javascript script in the solution, so that there is a link between the javascript script and the resource file.

    In my solution in dataverse, I went to the web resources files, selected my script and edited it in classic. There I added the dependency, making sure I changed the filter from javascript to resx files.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: Javascript/Typescript script for Command button can't find resources file with text strings in Model-driven app

    Hello,

    Please take a look at this thread: community.dynamics.com/.../resource-does-not-exist-when-using-xrm-utility-getresourcestring
    T
    his one as well: http://howto-mscrm.com/2017/11/dynamics-365-v9-0-string-resx-web-resources-a-better-world-with-localization.html 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans