Skip to main content

Notifications

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
    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
    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
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans