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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to debug javascript code which is called by a custom Button?

(0) ShareShare
ReportReport
Posted on by 727

Hi all,

We are using CRM2013 SP1 on premise

We have extended a form using Ribbon Workbench with a Custom Button which calls a javascript function.

This java script function calls an Action in CRM. We need to troubleshoot an issue. Therefore I'd like to debug the java script code using either Chrome or IE11. But I was not able to find my javascript function within Chrome? In order to make it easier I have a variable with a very special and uniquen ame in the code. I was then searching for this using Chrome and IE11 debuggers. But I was not able to find it.

Is it all possible to use the Chrome or IE11 built-in debuggers to debug java script files which are called by a custom button?

Many thanks for your help

Alen

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Thomas V. Profile Picture
    on at
    RE: How to debug javascript code which is called by a custom Button?

    If you don't want to modify your js code to add a debugger line, you can also write a line in your browser console (function(){debugger; yourRibbonFunction();})() to enter in the function and debug it.

  • alen1979 Profile Picture
    727 on at
    RE: How to debug javascript code which is called by a custom Button?

    Thanks guys, both solution work!

  • Verified answer
    Royal King Profile Picture
    27,686 on at
    RE: How to debug javascript code which is called by a custom Button?

    Yes you should be able to debug script that is called in custom button. If you use IE it will be very easy to enable debugging by adding debug in the script.Here is the list of steps that you have to do to debug in IE.

    1. Make sure you have unchecked disable script debugging(Internet Explorer) in internet Options in IE browser

    5545.Capture1.PNG

    2.Add debug; as first line in your javascript function

    Once you have above steps done clean all your browser temporary files and open the form where you have custom button and click on it. Once you click on it browser will pop-up window to attach debugger to your visual studio.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to debug javascript code which is called by a custom Button?

    Hi Alen

    You can debug the function which is called from Button click event or enable/disable rule.

    1. Simple add "debugger;" word with terminator in start of required function.

    2. Refresh the CRM by F5 in IE.

    3. Open debugger from F12. When debugger will open it will load CRM in browser again.

    4. Now whenever that function ill call, pointer will come at debugger to debug.

    Hope this help !! Please mark answer as verified if it helped.

    Let me know if you need any more assistance. Thanks

    Regards,

    Kamran

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans