# Load record data when pressing TAB key in UD field **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-09-20 01:11 UTC **Views:** 1849 **Replies:** 2 **URL:** https://www.epiusers.help/t/load-record-data-when-pressing-tab-key-in-ud-field/35393 --- ## Post #1 by @rbucek Form: Yahoo Group Forward Hi, Is it possible to get part description for a part number when pressing the TAB key for a UD field? I have used EpiBinding: CallContextBpmData.Character01 and CallContextBpmData.Character02 for my 2 textboxes and added a simple search button. Instead of pressing the search button and waiting for the window to open,let's say that I type the part num, and if it exists in the DB when TAB key is pressed, I'd like to also retrieve the part description... Thanks! Johnny --- ## Post #2 by @josecgomez You can use the simple search option in a customization and a validate event to trigger the search. I'll see if I can find some code to throw together for ya -Jose --- ## Post #3 by @hkeric.wci This here should get your started. // On top within your class Script add EpiTextBox txtKeyField; // Inside your InitializeCustomCode() add // you might need to change the actual key fields GUID this.txtKeyField = ((EpiTextBox)csm.GetNativeControlReference("46567b2e-6bc0-4967-be35-a0ec6843838f")); this.txtKeyField.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtKeyField_KeyDown); // Inside your DestroyCustomCode() add this.txtKeyField.KeyDown -= new System.Windows.Forms.KeyEventHandler(this.txtKeyField_KeyDown); // Add this code to your Customization // modify it as needed with extra checks etc... private void txtKeyField_KeyDown(object sender, System.Windows.Forms.KeyEventArgs args) { if (args.KeyCode == Keys.Tab | args.KeyCode == Keys.Enter) { string key1 = String.Empty; string key2 = String.Empty; string key3 = String.Empty; string key4 = String.Empty; string key5 = String.Empty; key1 = this.txtKeyField.Text; // Call Adapter method bool result = this.oTrans.GetByID(key1, key2, key3, key4, key5); if (!result) { DialogResult dialogResult = EpiMessageBox.Show("Record does not exist, would you like to create a new one?", "New Record?", MessageBoxButtons.YesNo); if ((dialogResult == DialogResult.Yes)) { if (this.oTrans.GetNew()) { //this.txtKeyField.Text = key1; EpiDataView edvOEM = this.oTrans.Factory("UD100"); edvOEM.dataView[edvOEM.Row]["Key1"] = key1; this.oTrans.Update(); } } } } } --- **Canonical:** https://www.epiusers.help/t/load-record-data-when-pressing-tab-key-in-ud-field/35393 **Original content:** https://www.epiusers.help/t/load-record-data-when-pressing-tab-key-in-ud-field/35393