Designer includes various
features and strategies for debugging calculations and scripts,
depending on the scripting language you choose.
the messageBox methods to provide debugging feedback.
One disadvantage of this method is that you must close many message
boxes. Another problem is that displaying a message box can cause
differences in the form’s behavior, especially if you are trying
to debug a script that is setting focus to an object on your form. It
is best to use console.println to output text to
Designer Report palette warning and validation messages
palette provides warning and validation messages to help you debug a
form as you design it. The Warning tab lets you view errors or messages
that Designer generated as you design a form. The Log tab lets you
view the following errors and messages:
For more information about using the Report
palette, see Using the workspace to debug calculations and scripts.
Providing debugging feedback using the messageBox method
The XML Form Object Model messageBox method
lets you output information from an interactive form into a dialog
box at run time. You can take advantage of the XML Form Object Model messageBox method
to display messages or field values at runtime. When initiated,
the messageBox method displays a string value in
a new client application dialog box. The string value can be a text message
that you create for debugging purposes or the string value of fields
For example, consider a scenario with a simple
form design that contains a single numeric field (NumericField1)
and a button (Button1). In this case, the following FormCalc calculation
and the value currently displayed in the numeric field. By adding
either the calculation or the script to the click event
of the button object, you can interactively display the value of
the numeric field in a new dialog box by clicking the button.
xfa.host.messageBox(Concat("The value of NumericField1 is: ",
NumericField1), "Debugging", 3)
xfa.host.messageBox("The value of NumericField1 is: " +
NumericField1.rawValue, "Debugging", 3);
Important: The messageBox method returns
an integer value representing the button that the form filler selects
in the message box dialog. If you attach the messageBox method
to the calculate event of a field object, and the messagebox method
is the last line of the script, the field displays the return value of
the messageBox method at runtime.
informatin about using the messageBox, see messageBox
Output information into a text field
You can output information,
such as field values or messages, into a text field on your form
design. For example, you can append new messages or values to the value
of a text field to create a log for future reference..