Home > SI5 Documentation > User Guide > Reports > Tips and Tricks > Invocation Error When Running Custom Reports

Invocation Error When Running Custom Reports

Table of contents
No headers

invocationIssue: You create a custom report off of an existing report for a Work Order, Task, etc…  and when you attempt to run the report you get hit with the following error:

Exception has been thrown by the target of an invocation.

 

 

 

 

exception-has-been-thrown

Cause: An object was deleted from the report that is referenced in the reports script.  Objects on our “Orders & Scheduling” reports differ from the SI5.5 Standard Reports and a few have scripts to generate the data.  Some of the objects include (varies by report): Customer Address, Company Address, Proj, SONumber, etc.

company-fields

Solution: If you are getting this error, you’ve already deleted the field(s) in the report so you must “comment out” the now “orphaned” script.

1.       Open the report in question in the Orders & Scheduling Report Designer

report-designer

2.       Click the “Script” tab along the bottom of the interface:

script-tab

3.       Hopefully you remember what objects you deleted from the report.  Look for lines of code that start with “ReportsUtilities.SetTextBoxValue” and find the ones that reference the names of the objects you deleted (in this example I deleted the “CompanyName” and “CompanyAddress” text boxes from a “Work Order by Location” report):

script-code

4.       To comment out the script, simply type an apostrophe in front of the code.  The text will turn green and be italicized:

commented-out

5.       Publish the report and it should run without throwing the error.

Note: On future reports, you may find it easier to simply not display a field on the report rather than delete it.  To do this, select the object on the report and then in the Properties window change the value of “Visible” to “False”

visible-false

-Seth Enos

You must to post a comment.
Last modified
16:02, 26 Nov 2013

Tags

Classifications

This page has no classifications.