Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Call a JavaScript function in another JavaScript library

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Is there a way to call a MS system JavaScript function from within a custom JavaScript library in CRM 2016? For example, on a quote, I am customizing the Activate Quote button to set a flag on the quote before closing the quote. I am able to get the button to launch the custom JavaScript to set the flag, but I am having trouble getting the system ActivateQuote function to fire afterwards. I tried adding a second action on the ribbon command, but it didn't fire. Now I am trying to call the ActivateQuote function in /_static/SFA/quotes/quote.js. Does anyone know how I can do that?

*This post is locked for comments

  • Suggested answer
    JohnAnonymous Profile Picture
    JohnAnonymous 5,241 on at
    RE: Call a JavaScript function in another JavaScript library

    I've done the same thing with promoting a lead. I changed the action to my custom JavaScript function and then added the default call to the JavaScript method in my own function.

    The way JavaScript works is that you can just call the function if the JavaScript library is loaded, as the functions are all added to the global dom. The only thing that might be an issue, is that with Turbo forms your resource won't be loaded. But that's something you have to test.

    It is not supported, but in my case it works without error and I'm using an onpremises environment where I have control over CRM updates.

    I just have this line of code in my JavaScript function:

    Mscrm.LeadCommandActions.qualifyLeadQuick();


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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans