A quick and easy way to place a "flashlight" in the form load script is to use an error message. There are 2 different ways of doing this.
The first way is to use the forms built in failure message as follows:
fieldData.put("failureMessage", 'I can return an error message to the user.');
fieldData.put("redirectOnFailure", "true");
return;
This produces a message that looks like this:
When the "Ok" button is pressed, the form then closes.
The second way is to use a JavaScript throw statement as follows:
throw 'I can throw an error in the script.';
This produces a message that looks like this:
In this case, when the "Ok" button is pressed, the form is not closed.
With both of these options, displaying a large amount of data, or structured data like XML does not work very well and using another method will usually work better.