If you are already working with the UD06 table entry screen you already have a connection to the adapter for that table. Use the object explorer to see what methods are available. There should be a get new method that can be called. if you use these methods you "probably" won't need to do a refresh. The object explorer will also list if there is a refresh method if it turns out you need it.
The other option is to cast an adapter reference to the existing adapter and make direct calls to the adapter methods.
Your current code makes a new connection to an adapter, gets a new record and then disposes of the adapter so there isn't anything to update after the call.
Jim Kinneman
Encompass Solutions, Inc
The other option is to cast an adapter reference to the existing adapter and make direct calls to the adapter methods.
Your current code makes a new connection to an adapter, gets a new record and then disposes of the adapter so there isn't anything to update after the call.
Jim Kinneman
Encompass Solutions, Inc
--- In vantage@yahoogroups.com, "jtannehill07" <jtannehill07@...> wrote:
>
> I am trying to make a customization on the UD06 entry screen to become a Job Status entry on the shop floor for our roll-formers so when they start the panel they scan the job number barcode and when they get done the scan the lot or lot number barcodes to the Ud06 Maintenance screen and it saves it to the ud06 table. On completion of the last field on the screen I would like it to automactily save and make a new blank record so the can continue with the next job without touching the keyboard and using the barcode scanner only.
> I have made a button on the custimization to try to mock the Default new button to test if I am even calling the right method to make a new record and it seems to be (as in i can see in my trace that it is firing the GetaNewUD06 just like the Default new button) but it does not seem to refresh the UI like the default New button. Is there something I need to put into my C# code to refresh the UI Layer or am I way off. I am finding it difficult to find info about the available methods and how to call them in C#.
>
> My Code:
> // **************************************************
> // Custom code for UD06Form
> // Created: 7/29/2013 8:49:17 AM
> // **************************************************
> using System;
> using System.ComponentModel;
> using System.Data;
> using System.Diagnostics;
> using System.Windows.Forms;
> using Epicor.Mfg.BO;
> using Epicor.Mfg.UI;
> using Epicor.Mfg.UI.Adapters;
> using Epicor.Mfg.UI.Customization;
> using Epicor.Mfg.UI.ExtendedProps;
> using Epicor.Mfg.UI.FormFunctions;
> using Epicor.Mfg.UI.FrameWork;
> using Epicor.Mfg.UI.Searches;
>
> 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 void InitializeCustomCode()
> {
> // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
> // Begin Wizard Added Variable Initialization
>
> // End Wizard Added Variable Initialization
>
> // Begin Wizard Added Custom Method Calls
>
> this.epiButtonC1.Click += new System.EventHandler(this.epiButtonC1_Click);
> // 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
>
> this.epiButtonC1.Click -= new System.EventHandler(this.epiButtonC1_Click);
> // End Wizard Added Object Disposal
>
> // Begin Custom Code Disposal
>
> // End Custom Code Disposal
> }
>
> private void CallUD06AdapterGetaNewUD06Method()
> {
> try
> {
> // Declare and Initialize EpiDataView Variables
> // Declare and create an instance of the Adapter.
> UD06Adapter adapterUD06 = new UD06Adapter(this.oTrans);
> adapterUD06.BOConnect();
>
>
> // Call Adapter method
> bool result = adapterUD06.GetaNewUD06();
>
> // Cleanup Adapter Reference
> adapterUD06.Dispose();
>
> } catch (System.Exception ex)
> {
> ExceptionBox.Show(ex);
> }
> }
>
> private void epiButtonC1_Click(object sender, System.EventArgs args)
> {
> CallUD06AdapterGetaNewUD06Method();
> oTrans.Update();
> //** oTrans.Refresh gives error 'Epicor.Mfg.UI.App.UD06Entry.Transaction' does not contain a definition for 'Refresh'
> oTrans.Refresh();
> }
>
>
> }
>