Clear UD fields in Customization

We are using the Packout function on our Hand Held screen and have added 2 text boxes to the lines tab. When processing a line and entering a quantity and pressing tab the record updates and clears all the fields except for the 2 text boxes. To try and fix that we have the following code that partially works. On pressing tab to process the record it does clear the fields but when adding a new record when clicking in the 2 added text box fields the previous value re-appears. Need some way to clear. Below is the code.
Any Suggestions?

// **************************************************
// Custom code for HHPackOutForm
// Created: 5/24/2019 2:13:38 PM
// **************************************************

extern alias Erp_Contracts_BO_CustShip;
extern alias Erp_Contracts_BO_PackOutSearch;
extern alias Erp_Contracts_BO_PickedOrders;
extern alias Erp_Contracts_BO_MaterialQueue;
extern alias Erp_Contracts_BO_Part;
extern alias Erp_Contracts_BO_Warehse;

using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

public class Script
{
// ** Wizard Insert Location - Do Not Remove ‘Begin/End Wizard Added Module Level Variables’ Comments! **
// Begin Wizard Added Module Level Variables **

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **
public EpiNumericEditor eneQty;

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization
	eneQty = (EpiNumericEditor)csm.GetNativeControlReference("d161e1cf-d757-4335-a56c-ae76c8b11faa");
	// End Wizard Added Variable Initialization

	// Begin Wizard Added Custom Method Calls

	this.eneQty.Leave += new System.EventHandler(this.eneQty_Leave);
	// End Wizard Added Custom Method Calls
}

public void DestroyCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
	// Begin Wizard Added Object Disposal
	eneQty = null;
	this.eneQty.Leave -= new System.EventHandler(this.eneQty_Leave);
	// End Wizard Added Object Disposal

	// Begin Custom Code Disposal

	// End Custom Code Disposal
}

private void eneQty_Leave(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	if(0 != Convert.ToDecimal(eneQty.Value))
	{
		txtbxSN1.Value = "";
		txtbxSN2.Value = "";
	}
}

}

Are those 2 textboxes bound to the dataset?

Yes they are bound to a dataset I think. CallContextBpmData.Character01 and CallContextBpmData.Character01 and then a BPM is doing the updating.

I am guessing I need to clear the callContexBPMData as well but not good with the syntax stuff.

The Data Directive BPM that updated these fields to the ShipDtl table is below. Somehow I think I need to clear the values once the data is updated.

if(callContextBpmData.Character01 != “”)
{
foreach(var ttShipDtl_iterator in(from ttShipDtl_Row in ttShipDtl
select ttShipDtl_Row))
{
var ttShipDtlRow = ttShipDtl_iterator;
if(ttShipDtlRow != null)
{
ttShipDtlRow.Character01 = callContextBpmData.Character01;
}
}
}

if(callContextBpmData.Character02 != “”)
{
foreach(var ttShipDtl_iterator in(from ttShipDtl_Row in ttShipDtl
select ttShipDtl_Row))
{
var ttShipDtlRow = ttShipDtl_iterator;
if(ttShipDtlRow != null)
{
ttShipDtlRow.Character02 = callContextBpmData.Character02;
}
}
}

Although the solution is not clear it caused me to look further in which I found a BPM that updated the fields from the Call Context. I added some code to clear the call context fields after updating which resolved the issue.

I know it’s a long time, but by chance you’ll still remember how you solved it, I’m in the same dilemma.

We are on a different version now but here is the BPM. I can send you a solution file if you like. We were using the handheld screen to ship so that is why we are using the POUpdateAndDisplay. In this case the PO stands for Pack Out not Purchase Order.

Tarter_SigLockups-01_4f8a4239-3b88-402b-84ae-be247a59d65f.png

That would be great.
Thanks