Introducing Script Debugging

Thursday, 6 January 2022 by John Rickard

finPOWER Connect version 3.04.03 introduces support for debugging scripts.

This is very useful to delve into script code whilst it is running, and then, for example, trace code and examine variables.

You can debug any object in finPOWER Connect that supports scripting. This includes:

  • Account Application Types
  • Decision Cards
  • Documents
  • Page Sets
  • Portals
  • Queues
  • Report Templates
  • Scripts
  • Workflow Types

In addition, if the script includes a Function Library, the code for that Function Library is part of the code being debugged.

You will need to install a debugger before proceeding. We suggest you use Visual Studio 2022 Community Edition. See https://visualstudio.microsoft.com/vs/community/.

Enabling Debugging

To turn on debugging, go to Tools, User Preferences, Developer group, General page and check "Enable Debugger facility?".

Created from paste into Topic content

Next, add finBL.DebugLaunch() to the script code where you want to open the debugger.

Created from paste into Topic content

Make sure you turn off the Debugger facility when finished and remove or comment out finBL.DebugLaunch() statements in code.

The Debugger

When the script code is run, and a finBL.DebugLaunch() function is encountered the Debugger will open.

If multiple Debuggers are installed you will be prompted to choose a debugger.

Within the debugger, the script code will be opened and paused at the finBL.DebugLaunch() line.

The short video below shows the debugger stopping, the User setting a breakpoint, then continuing the code to enter parameters. The debugger then stops at the breakpoint set previously, where variables are inspected.