Add Report Quantity menu to Epicor

I am looking to add a menu path to Report Quantity in the regular Epicor client. Seems straightforward but when I wire it up, it throws some errors when I launch it. What in tarnation is so different from launching in MES (where it launches just fine)?

Exception caught in: System.Data

Error Detail
============
Message: Index 0 is either negative or above rows count.
Program: System.Data.dll
Method: GetRow

Client Stack Trace
==================
at System.Data.DataView.GetRow(Int32 index)
at Erp.UI.App.ReportQtyEntry.RQForm.OnFormLoaded()
at Ice.Lib.Framework.EpiBaseForm.formLoaded()

And then this one follows right behind:

Exception caught in: System.Data

Error Detail
============
Message: Index -1 is either negative or above rows count.
Program: System.Data.dll
Method: GetRow

Client Stack Trace
==================
at System.Data.DataView.GetRow(Int32 index)
at Erp.UI.App.ReportQtyEntry.RQTransaction.BackflushMaterialOnLastJobOperationSearch()
at Erp.UI.App.ReportQtyEntry.RQTransaction.Transaction_EpiViewChanged(EpiViewChangedArgs args)
at Ice.Lib.Framework.EpiTransaction.onViewChanged(EpiDataView CurrentView, EpiDataView LastView)
at Ice.Lib.Framework.EpiTransaction.set_LastView(EpiDataView value)
at Ice.Lib.Framework.EpiTextBox.EpiTextBox_Enter(Object sender, EventArgs ea)

And then this last one:

Application Error

Exception caught in: System.Data

Error Detail
============
Message: Index -1 is either negative or above rows count.
Program: System.Data.dll
Method: GetRow

Client Stack Trace
==================
at System.Data.DataView.GetRow(Int32 index)
at Erp.UI.App.ReportQtyEntry.RQTransaction.BackflushMaterialOnLastJobOperationSearch()
at Erp.UI.App.ReportQtyEntry.RQTransaction.Transaction_EpiViewChanged(EpiViewChangedArgs args)
at Ice.Lib.Framework.EpiTransaction.onViewChanged(EpiDataView CurrentView, EpiDataView LastView)
at Ice.Lib.Framework.EpiTransaction.set_LastView(EpiDataView value)
at Ice.Lib.Framework.EpiButton.setLastViewWhenActivated()

You need LaunchFormOptions.

Let me look at what it needs.

1 Like
using System.Collections.Specialized;

LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.SuppressFormSearch = true;

StringDictionary myDict = new StringDictionary();

myDict.Add("laborhead", laborHed);
myDict.Add("labordet", laborDtl);

lfo.ValueIn = myDict;

ProcessCaller.LaunchForm(oTrans, "PR000077", lfo);

You’re gonna need a launcher form to provide this info.
I would customize a UD form or something that starts hidden,
launches ReportQty, and exits.

1 Like

When launching in MES, it opens in context to the active labor record selected in the grid view. In the standard client, it doesn’t know what LaborDtl record to relate the transaction to.

2 Likes

@zwilli526 @klincecum thank you both! That makes complete sense. I didn’t realize that it would load those labor records when launching it. If you have no labor records active, it launches fine in MES and then a user can directly specify which operation is to be reported. I suspect doing what you’ve suggested will allow the same type of behavior in Epicor.