Inventory Transfer Customization Error

Hey guys, we recently migrated to Kinetic early last month and we’ve slowly made head way on updating all failing customizations.

We have a customization under Inventory Transfer. The customization compiles fine, there is no “error” or “warnings” under customization maintenance.

However when you open it, you get this error:

Application Error

Exception caught in: mscorlib

Error Detail 
============
Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: Object reference not set to an instance of an object.
Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod

Client Stack Trace 
==================
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeCustomFormLoadIfExists(String methodName, Object sender, EventArgs e)
   at Ice.Lib.Customization.CustomScriptManager.<>c__DisplayClass104_0.<OnCustomCodeFormLoad>b__0()
   at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxOrLogVerificationErrorIfException(Action action, String exceptionBoxTitle)

Inner Exception 
===============
Object reference not set to an instance of an object.at Script.InvTransferForm_Load(Object sender, EventArgs args)

I’ve encountered this before, and instead just re-created the customization off of the base.

The problem now with that is I’m getting these errors:

Error: CS0246 - line 129 (700) - The type or namespace name ‘WarehseAdapter’ could not be found (are you missing a using directive or an assembly reference?)

I’ve added the custom assemblies and verified the match the working customization on our old productions server (E10).

Any idea what I could be missing?

I can paste the entire code, but it’s an old jumbled mess that probably just needs to be cleaned up. Any help would be GREATLY appreciated.

Here’s the first snippet that fails:

rivate void cToWhse_Leave(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		if (cToWhse.Text != "")
		{
		//Update whse from entry in cWhse field and manually select bin
		try
		{
			
			WarehseAdapter adWhse = new WarehseAdapter(this.oTrans);
			adWhse.BOConnect();

			string stringId = cToWhse.Text;

			bool result = adWhse.GetByID(stringId);

			if (result)
			{
			string ToWhseName = adWhse.WarehseData.Warehse.Rows[0]["Description"].ToString(); 
			EpiDataView view = ((EpiDataView)(this.oTrans.EpiDataViews["view"]));
			view.dataView[view.Row]["ToWarehouseCode"] = cToWhse.Text;
			view.dataView[view.Row]["ToWarehouseDesc"] = ToWhseName;
			oTrans.NotifyAll();
			EpiTextBox BinText = (EpiTextBox)csm.GetNativeControlReference("e4286565-e4c0-4e9e-ae3d-3ceb8e0bcc2d");
			BinText.Focus();
			
			}
			adWhse.Dispose();

		} catch (System.Exception ex)
		{
			MessageBox.Show(Convert.ToString(ex));
		}
	}
		
	}

image

Here are the custom assemblies.

Something may have changed as this type is not being found using the assemblies/references already present.

is using Erp.Adapters; present in the usings?

Nope, WarehseAdapter is still correct.

Yes, this was present in the usings. I was able to rectify this by creating a NEW base and instead of manually adding the assemblies I went here:

Tools > Wizards > Customization Wizards > Reference Adapter/BL Assemblies > Get Adapters > WarehseAdapter

THis got rid of the error. Code compiles file now, no errors…

HOwever upon launching this customization, I still get this random error:
image

Application Error

Exception caught in: mscorlib

Error Detail 
============
Message: Exception has been thrown by the target of an invocation.
Inner Exception Message: Object reference not set to an instance of an object.
Program: CommonLanguageRuntimeLibrary
Method: InvokeMethod

Client Stack Trace 
==================
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeScriptMethod(MethodInfo scriptMethod, Object[] parameters)
   at Ice.Lib.Customization.CustomScriptMethodInvoker.InvokeCustomFormLoadIfExists(String methodName, Object sender, EventArgs e)
   at Ice.Lib.Customization.CustomScriptManager.<>c__DisplayClass104_0.<OnCustomCodeFormLoad>b__0()
   at Ice.Lib.Customization.CustomScriptManager.TryActionShowExceptionBoxOrLogVerificationErrorIfException(Action action, String exceptionBoxTitle)

Inner Exception 
===============
Object reference not set to an instance of an object.
   at Script.InvTransferForm_Load(Object sender, EventArgs args)

Let’s see it.

Sure, spare your judgement :grimacing: I had no partake in this.

	private void InvTransferForm_Load(object sender, EventArgs args)
	{
		EpiDataView view = ((EpiDataView)(this.oTrans.EpiDataViews["view"]));
	
		if(InvTransferForm.LaunchFormOptions.ContextValue != null)
		{
	        object ctxValue = InvTransferForm.LaunchFormOptions.ContextValue;
			string ctx = ctxValue.ToString();
			string[] val = ctx.Split('|');			
			view.dataView[view.Row]["TransferQty"] = Convert.ToDecimal(val[1]);
			view.dataView[view.Row]["ToWarehouseCode"] = val[2];
			view.dataView[view.Row]["ToWarehouseDesc"] = val[3];
			view.dataView[view.Row]["ToBinNum"] = val[4];
			return;
		}
	
		if(InvTransferForm.LaunchFormOptions.ContextValue == null)
		{
			string LFO = InvTransferForm.LaunchFormOptions.Sender.ToString();
			//string callingApp = ((Ice.UI.Dashboard.DashboardQuery)(InvTransferForm.LaunchFormOptions.Sender)).WhoAmI;
	
			if(LFO == "Ice.UI.App.BOOTH_DEPT_DASHBOARD.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "050";
				view.dataView[view.Row]["ToWarehouseDesc"] = "BOOTH #1";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.AD_STAN_DASHBOARD.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "010";
				view.dataView[view.Row]["ToWarehouseDesc"] = "STAIN";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.EDGEBAND_DEPT_DB.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "110";
				view.dataView[view.Row]["ToWarehouseDesc"] = "EDGEBANDING";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.TABLE_TOP_DASHBOARD.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "100";
				view.dataView[view.Row]["ToWarehouseDesc"] = "TRASH/TOPS";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.UPHOLSTERY_DASHBOARD.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "160";
				view.dataView[view.Row]["ToWarehouseDesc"] = "UPHOLSTERY";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.SOLID_SURFACE_DB.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "060";
				view.dataView[view.Row]["ToWarehouseDesc"] = "SOLID SURFACE";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.MILLWORK_DEPT_DB.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "070";
				view.dataView[view.Row]["ToWarehouseDesc"] = "MILLWORK #1";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.CNC_FLAT_DB.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "001";
				view.dataView[view.Row]["ToWarehouseDesc"] = "CNC";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.AD_Metals_Dashboard.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "210";
				view.dataView[view.Row]["ToWarehouseDesc"] = "METALS";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.AD_POW_DB_1.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "170";
				view.dataView[view.Row]["ToWarehouseDesc"] = "POWDER COAT";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
	
			if(LFO == "Ice.UI.App.FIBERGLASS_DASHBOARD.MainController")
			{
				view.dataView[view.Row]["ToWarehouseCode"] = "240";
				view.dataView[view.Row]["ToWarehouseDesc"] = "FIBERGLASS";
				view.dataView[view.Row]["ToBinNum"] = "FLOOR";
			}
		}
	}

start wrapping parts of that with try / catch, and messagebox to see what is null.

1 Like

Tried this, the same error printed out each time… really stumped on this one.