Practice Using the Script Debugger - Breakpoints and Variables
- In the Script, set breakpoints by clicking the gutter to the left of the lines beginning with: var myNum, var priorityValue, var createdValue
- Select Open Script Debugger icon on the Syntax Editor toolbar or the System Diagnostics > Script Debugger module on the Application Navigator. The Script Debugger opens in another browser window
- Notice the list of all breakpoints set in the platform by you appears on the left-side of the code pane
- Set another breakpoint by clicking the gutter to the left of the line beginning with SlaTargetNotification
- What can you conclude about where breakpoints can be set? Record your answer
- Keep the Script Debugger window open. Force the Lab 5.1 Business Rule Debugging Business Rule to execute ->
- Open any active Incident, change the value of State to anything except Closed
- Save the record remain on the form
- Select Start Debugging
- Script execution is paused at the first breakpoint. How can you tell?
- Examine the value of the myNum variable in the Local variables section on the right-side of the window. Does it contain the value you expected?
- Select the Next Breakpoint button to resume script execution and pause at the next breakpoint
- Re-examine the value of the myNum variable in the Local variables section. What value does it contain now?
- Explain why the myNum variable value is sometimes undefined and sometimes has a value
- Repeat steps 11-13 to watch values of the priorityValue and createdValue variables update as you step through the code
- When you reach the breakpoint on the line beginning with SlaTargetNotification, select the Next Breakpoint button one last time to complete the execution of the script
- Think of an example in the past where you declared variables in a script and they did not return the values you were expecting. Would it have been helpful to have variable value output available like this?