web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to load jsPDF as a dependency for other javascript file to use?

(0) ShareShare
ReportReport
Posted on by 105

I want to add a custom button to the grid that when pressed will call my javascript function that relies on jspdf

I created 2 new web resources

  1. using https://github.com/parallax/jsPDF/blob/master/dist/jspdf.es.js 
  2. My custom javascript utilizes jsPDF

I use Ribbon Workbench to add 2 actions for the command.

  1. The 1st action calls the jspdf webresource with "isNaN" function name
  2. The 2nd action calls my js webresource with my function name.

When I click on the custom button, I get javascript error "ReferenceError: jsPDF is not defined" on the line "let pdf = new jsPDF("p", "pt", "a4");" it seems that jsPDF is not being loaded at all?

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Kirk T,

    Which is your version of Dynamics 365? Is it V9?

    If yes, you could add your jspdf web resource to another JS web resource's dependence like this:

    pastedimage1639638726380v1.png

    Below is my test:

    My person.js:

    function Person(name,age) {
        this.name = name;
        this.age = age;
    }

    Another JS web resource:

    function preSetText(executionContext){
    var someone = new Person("someone",20);
    console.log(someone);
    }

    Add a button on my account form with another JS as command:

    pastedimage1639638985861v2.png

    Result:

    pastedimage1639639075841v3.gif

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 172

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans