Hi all!
I am using the code below in my customization to run a custom action from my UBAQ.
void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
{
BAQDataView BAQView = (BAQDataView)iEdv;
Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
mi.Invoke("Ice.Lib.Framework.BAQUpdater", new object[]{BAQView, iActionID});
}
In the past this has worked perfectly, but recently I started getting this error when it runs on one specific BAQ.
Application Error
Exception caught in: App.UD03Loader.MainController.EP.VTAERO.Customization.MainForm.CustomCode.13
Error Detail
============
Message: Unable to cast object of type 'Ice.Lib.Framework.FilteredBAQDataView' to type 'Ice.Lib.Framework.BAQDataView'.
Program: App.UD03Loader.MainController.EP.VTAERO.Customization.MainForm.CustomCode.13.dll
Method: BAQRunCustomAction
Client Stack Trace
==================
at Script.BAQRunCustomAction(EpiDataView iEdv, String iActionID)
at Script.epiButtonC1_Click(Object sender, EventArgs args)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButtonBase.OnClick(EventArgs e)
at Ice.Lib.Framework.EpiButton.OnClick(EventArgs e)
at Infragistics.Win.Misc.UltraButton.OnMouseUp(MouseEventArgs e)
at Ice.Lib.Framework.EpiButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Debugging in VS indicates that this line is the culprit:
BAQDataView BAQView = (BAQDataView)iEdv;
I don’t believe I ever set any filters to my BAQ, if so I don’t see where or how. I either need to figure out how to turn off the filter, or figure out how to cast a FilteredBAQDataView to a BAQDataView.
Has anyone encountered this before? Do you have any ideas how I can fix it?
Thanks!
Nate