Article Details
Id:13007
Product:finPOWER Connect
Type:NEW
Version:2.03.00
Opened:16/06/2015
Closed:17/06/2015
Released:09/07/2015
Job: J015714

Scripts; Trace warnings are written when compilation fails to assist in debugging

In certain circumstances, a Script may compile correctly from the Scripts form but fail to compile when used in other situations.

For example, an 'HTML Report' type Script requires access to the finPOWER Connect User Interface and Reports layers. Therefore, if you have a Page Set Script that attempts to call an 'HTML Report' Script as follows:

If finBL.Scripts("MyReport").ExecuteHtmlReport(ReturnValue, mUI, Nothing, html) AndAlso ReturnValue Then
  htmlSummary.Text = html
Else
  finBL.DebugPrint(finBL.Error.Details)
End If

Then the 'MyReport' Script would fail to compile since it is being passed mUI (the User Interface object) but is being passed Nothing instead of the Reports object (which HTML Reports require).

The following example passes the Reports object (mReports) to the 'HTML Report' Script and therefore will work correctly:

If finBL.Scripts("MyReport").ExecuteHtmlReport(ReturnValue, mUI, mReports, html) AndAlso ReturnValue Then
  htmlSummary.Text = html
Else
  finBL.DebugPrint(finBL.Error.Details)
End If

When Script compilation fails, the compilation errors can be viewed from the Debug window, Debug Trace page (providing the 'Warnings' checkbox is checked). This makes it easier to debug Script issues such as this.