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 = "";
}
}
}