Inconsistent error in customization

I have a very odd situation that I’m hoping someone may have a bit of insight that I’m just missing at this point.

I have a customization that works perfectly without error in a Development environment. I have moved it to a Test environment. Suddenly, I am getting an error.

The customization is on a Dashboard Assembly that contains a UBAQ. When a button is clicked, it will invoke the RunCustomAction.

I’ve tested the custom action through the BAQ and I don’t receive an error. So, I’m only getting the error in the customization.

	private void btnUpdateWhse_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		oTrans.PushDisposableStatusText("Updating warehouses", true);
		var edvOrders = oTrans.Factory("V_EJP_OpenOrders_1View");
		BAQRunCustomAction(edvOrders, "ChangeWarehouse");
		Refresh();
		oTrans.PushDisposableStatusText(string.Empty, true);
	}

	private 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);
		object[] param = new object[] { BAQView, iActionID };
		mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);
	}

I do not get the error when I comment out the mi.Invoke("Ice.Lib.Framework.BAQUpdater", param); line. Both environments are on the same version of Epicor.

What’s the error

That would help, wouldn’t yet!

Business Layer Exception

This is a duplicate entry of an existing record

Exception caught in: Epicor.ServiceModel

Error Detail

Correlation ID: b076bd0d-d9c2-4477-b15e-2bb41da4da68
Description: This is a duplicate entry of an existing record
Program: Epicor.Ice.dll
Method: UpdateRow
Line Number: 1291
Column Number: 21
Table: OrderRel

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Ice.Proxy.BO.DynamicQueryImpl.RunCustomAction(DynamicQueryDataSet queryDS, String actionID, DataSet queryResultDataset) at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass43_0.<RunCustomAction>b__0(DataSet datasetToSend) at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func2 methodExecutor, Boolean refreshQueryResultsDataset)
at Ice.Adapters.DynamicQueryAdapter.RunCustomAction(DynamicQueryDataSet queryDS, String actionId, DataSet updatedDS, Boolean refreshQueryResultsDataset)

Is the custom action creating record? I think there is something amiss between the data in the dev environment vs. the test environment, rather than a technical problem