Debugging

Run scripts locally before you publish them.

Studio's debug harness runs C# scripts, and TypeScript or JavaScript extensions, on your machine with sample data, so you can see what they do before they reach the platform. Recent runtime logs for the app can be opened from Studio too.

Scripts in Studio

Custom scripts are where an app's rules become code: C# record hooks and workflow actions that run on the platform, and TypeScript or JavaScript extensions that run in the web app. See Custom scripts for what each kind does.

In Studio, a script has two halves. Its settings (what it is bound to, which operations and phase it runs in) open in a designer. Its code opens as a real file in the standard editor, so you get syntax highlighting, completion and navigation as you would in VS Code. The explorer groups scripts by what they are for.

Note

Scripts that already exist on the platform can be edited and published from Studio. A brand-new script is created outside Studio first; after TAF: Load latest from platform you can edit and publish it in Studio from then on.

Check Script

TAF: Check Script (the Check button) sends a C# script to the platform to be compiled without running it. The platform returns compiler diagnostics with line and column, plus findings from its security analysis, and Studio shows them as markers in the editor and entries in the Problems panel. A compile error becomes a squiggle on the line that caused it, before the script ever runs.

  • Security findings (for example file, process or reflection use) show as warnings unless the platform marks them as errors, because such patterns are sometimes legitimate in a hook.
  • A failed check can never read as “no problems found”: a failure without line details is reported at line 1.
Important

A validation hook that does not compile blocks every save on its object. Run Check Script before you publish any change to a hook.

Run and inspect a C# hook

TAF: Debug Script offers Run & inspect, which works against the platform you are signed in to and needs no local services. It checks the script, runs the hook once against a real record, and writes a run report into your working folder, then opens it. The report contains:

  • the verdict and any exception
  • compiler diagnostics
  • the errors the script reported and its full log
  • the resulting field values, and the input it ran against

The record the hook runs against is one you choose: pick a real row, paste one, or run with an empty input. Studio never invents test data.

Breakpoints

TypeScript and JavaScript

TypeScript and JavaScript scripts are not compiled by the platform; they run in the web app. Studio debugs them by running the script's own code under Node with a real context you supply. The script is written out unchanged, so a breakpoint on line 12 stops on line 12. The base classes that screen extensions build on ship inside Studio, so this works without a copy of the frontend source.

Node cannot reproduce the browser page or the web app's services. A script that touches those still runs, and Studio warns you which lines need the running app and the browser's own developer tools.

C#

A breakpoint in a C# hook needs the service that compiles the script to be running on your machine in developer mode, with a scripts folder that Studio and the service share. Studio places the script there, attaches a .NET debugger to the service process and triggers the hook. Before it does, it checks that the folder setting exists, is an absolute path and points at a real folder, because any of those mistakes would make breakpoints silently never hit. When the platform runs remotely, which is the usual case, use Run & inspect instead.

Runtime logs and requests

  • TAF: Show Recent Logs opens your app's own runtime logs (errors, warnings or everything) for the tenant, app and environment you are signed in to.
  • TAF: Show Recent Requests shows Studio's recent requests to the platform. Together with the logs, it is the first thing to share with your administrator when something does not behave.
  • TAF: Show Workflow Runs collects a published workflow's completed and failed runs from the platform logs.

What cannot be debugged

  • CSS has no executable statements, so there is nothing to break on.
  • SQL runs inside the database, not a process Studio can attach to. Run the query and inspect the result instead.
  • Calculated values and conditions written as expressions inside a screen's form definition have no file of their own and are not yet debuggable.