Debugging is one of most applicable and effective way to find out bugs or issues in a code. With the help of debugger you can observe your code line by line in real time.
Step 1:
Always remember to add debugger; in the function of the JS. This will work as a breakpoint in the code. Refer How to use JavaScript in Dynamics 365 CE?
function funtionName() {
debugger;
}
Step 2:
Press F12 before the event is triggered. Let’s take an example, OnLoad.

Press F12 and we will get the following page:

Refresh the page to hit the event.

In the screenshot you can see the code area, console and watch.
Code area : Where you can debug your code.
Console : Where you can add your statements to check for results or error.
Watch : You can add code to watch where it is stored in the cache. So that you don’t need to keep on coding to debug.
Press F10 to move/debug to next line.

These are some of the basic functions which comes in use most commonly. However, if you have any query regarding Dynamics 365 CE, feel free to connect.

