web
You’re offline. This is a read only version of the page.
close
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!

I have the same question (0)
  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at
  • Suggested answer
    Junius01 Profile Picture
    53 on at

    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.

  • Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Great. Good to hear that you found the solution

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans