We have a number of custom buttons in MES for launching forms, using C# code tied to the menu item ID. This is the first time I have added a menu item that is of the “report” style, and I am getting the following error:
Application Error
Exception caught in: Erp.Mfg.UIRpt.PCIDContectsReportEntry
Error Detail
============
Message: Unable to cast object of type 'System.String' to type 'System.Collections.Hashtable'.
Program: Erp.Mfg.UIRpt.PCIDContectsReportEntry.dll
Method: OnFormLoaded
Client Stack Trace
==================
at Erp.Mfg.UI.Rpt.PCIDContectsReportEntry.ReportForm.OnFormLoaded()
at Ice.Lib.Framework.EpiBaseForm.formLoaded()
The report still launches after clicking OK, but I am wondering if this has something to do with the parameters getting passed in on form load. I have searched through the trace and not sure where to go.
I was able to reproduce the error. Try adding a blank launch form options and passing it in the call. Killed the error for me.
LaunchFormOptions lfo = new LaunchFormOptions();
ProcessCaller.LaunchForm(this.oTrans, “Erp.Mfg.UIRpt.PCIDContectsReportEntry”,lfo);
(insert your menuID)
(Sorry, this text did not want to get formatted)
Not sure exactly why, but something related to the launch form options being a hashtable. Maybe a blank string was being passed instead, not sure. Maybe someone else can shed some light on why this is happening.