Hello everyone,
I am working on modifying the Job Entry form to display some related values from the UD06 table. I am trying to follow the FKV instructions in the customization manual, but I am coming up short.
UD06 contains a list of part numbers, job numbers, and quantities of those parts. These are parts that are not listed in our warehouse inventory. I would like to add a text box to the Job entry form showing the quantity of parts in UD06 for the part being viewed.
When I create the FKV, I choose JobHead. I set the column name to PartNum, then it automatically fills in the like column value as Part.PartNum, and adapter as PartAdapter. I changed this to UD06.Key01, and UD06Adapter, then added the FKV.
Back in the main form I try to insert a text box and assign the epibinding to my UD06.Number01 field to display the quantity, but I canāt find my UD06 fields anywhere. Looking back into the FKV I added, it looks like it replaced my entry of UD06 with the values it originally had.
Can anyone help me figure out how to link up the part shown on JobEntry, with my part listed in UD06, then show the quantity in the JobEntry form? Ideally the link would be based on both PartNumber, revision, and Job Number. Is that possible? Am I on the right track here? I could do this in a BAQ, but that wont help.
Thanks!
Nate
I went through this process and added the table as a child. But where do I find the fields? I donāt see them listed in epibinding. I am trying to assign UD06.Number01 to a text box on the form.
I see it added a bunch of code to my script editor.
I am not getting any errors after implementing the epicor solution in the link you provided. But my epibound text boxes are not getting populated with any values. I only need the quantity (UD06.Number01). I added a new tab and put in a few fields (epibinding text boxes) from ud06 just to see if I could see anything. Those fields donāt update at all when I load a job, or refresh the current job.
I also tried the marked solution from your link, but that method gave a lot of errors.
I got this approach to compile successfully, but the text box still will not show my values from UD06.
Here is the customization code for the Job Entry Form. As you suggested, I pulled out all the unnecessary auto generated code.
extern alias Erp_Contracts_BO_Project;
extern alias Erp_Contracts_BO_Part;
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 **
private UD06Adapter _ud06Adapter;
private EpiDataView _edvJobHead;
private DataTable UD06_Column;
private EpiDataView _edvUD06;
private string _Key1UD06;
private string _Key2UD06;
private string _Key3UD06;
private string _Key4UD06;
private string _Key5UD06;
private DataView JobHead_DataView;
// 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
InitializeUD06Adapter();
this._Key1UD06 = string.Empty;
this._Key2UD06 = string.Empty;
this._Key3UD06 = string.Empty;
this._Key4UD06 = string.Empty;
this._Key5UD06 = string.Empty;
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// 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
if ((this._ud06Adapter != null))
{
this._ud06Adapter.Dispose();
this._ud06Adapter = null;
}
this._edvUD06 = null;
this._edvJobHead = null;
this.UD06_Column = null;
this._Key1UD06 = null;
this._Key2UD06 = null;
this._Key3UD06 = null;
this._Key4UD06 = null;
this._Key5UD06 = null;
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void InitializeUD06Adapter()
{
// Create an instance of the Adapter.
this._ud06Adapter = new UD06Adapter(this.oTrans);
this._ud06Adapter.BOConnect();
// Add Adapter Table to List of Views
// This allows you to bind controls to the custom UD Table
this._edvUD06 = new EpiDataView();
this._edvUD06.dataView = new DataView(this._ud06Adapter.UD06Data.UD06);
this._edvUD06.AddEnabled = true;
this._edvUD06.AddText = "New UD06";
if ((this.oTrans.EpiDataViews.ContainsKey("UD06View") == false))
{
this.oTrans.Add("UD06View", this._edvUD06);
}
// Initialize DataTable variable
this.UD06_Column = this._ud06Adapter.UD06Data.UD06;
// Initialize EpiDataView field.
this._edvJobHead = ((EpiDataView)(this.oTrans.EpiDataViews["JobHead"]));
Erp.UI.FrameWork.JobLib.EpiDataViewRelation jobHeadUD06Relation = new Erp.UI.FrameWork.JobLib.EpiDataViewRelation(this._edvUD06);
Erp.UI.FrameWork.JobLib.EpiDataViewRelation jobRelation = new Erp.UI.FrameWork.JobLib.EpiDataViewRelation(this._edvJobHead);
// Set the parent view / keys for UD child view
string[] parentKeyFields = new string[3];
string[] childKeyFields = new string[3];
parentKeyFields[0] = "PartNum";
childKeyFields[0] = "Key1";
parentKeyFields[1] = "JobNum";
childKeyFields[1] = "Key2";
parentKeyFields[2] = "RevisionNum";
childKeyFields[2] = "Key3";
// Use SetParent not SetParentView
jobHeadUD06Relation.SetParent(jobRelation, parentKeyFields, childKeyFields);
// Magic Here
Erp.UI.FrameWork.JobLib.EpiDataViewFilterManager x = new Erp.UI.FrameWork.JobLib.EpiDataViewFilterManager(this.oTrans);
x.AddRelation(jobHeadUD06Relation);
if ((this.oTrans.PrimaryAdapter != null))
{
// this.oTrans.PrimaryAdapter.GetCurrentDataSet(Ice.Lib.Searches.DataSetMode.RowsDataSet).Tables.Add(this._edvUD06.dataView.Table.Clone())
}
}
}
I placed an EPI text box on the Job Entry Form, called txtOJI. I set the EPIbinding for this field to UD06View.Number01.
When I type in a job number, the form fills in correctly, but the related job/part/rev quantity from UD06.Number01 is not being populated in txtOJI.
I have gone through several attempts using the Foreign Key View, and this method with the child table wizard. I canāt seem to get anywhere with either. What the heck am I missing?
Thanks for your time!
Nate
The other person who said support helped him solve it by doing
Turn on Developer Mode
Open up Job Entry and select your Customization
Go to the Tools menu then Customization to go into Customization Mode
Go to the Script Editor tab of the Customization Tools dialog.
Find the last āusingā statement which should be: using Ice.UI.FormFunctions;
Immediately after it paste the following:
using System.Reflection;
Locate the InitializeCustomCode() method.
Add the following code below the end of this method, after the comment: // End Wizard Added Custom Method Calls
FieldInfo fInfo = _edvJobHead.GetType().GetField(āhasChildrenā, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);
if ( fInfo != null ) { fInfo.SetValue(_edvJobHead, false); }
Actually looking at your code, looks like you may be heading the right direction using JobLibā¦ so you need to add more events, to get your data. Epicor wont magically pull it in for you.
Use the Wizard to add your UD06 to JobHead, you are missing:
BeforeListChange
AfterListChanged
BeforeRowChange
AfterRowChange
OnRefresh
etcā¦
I never used a FKV to add it, always the Wizard and then control all the logic
Are you trying to just show data, or allow the user to manage data, add new rows, delete etcā¦?
Thanks Eric! Yes, I also tried the other approach of setting haschildren=false. But I came back to your method as it looks more promising.
When I used the wizard to add UD06View it adds all those events. I pulled them as I thought them unneeded.
I only want to show a read-only text field. Or, possibly even just a flag indicating a non-zero value in the number01 field. I do not need any user interaction with the UD06 table except to view the data on it, as it pertains to the relevant part in job entry.
On the main job entry form, I want to link to the parent part. While on the assembly level, I want to link on the assembly part number.
Here is the complete code, without removing the parts I thought were not needed.
extern alias Erp_Contracts_BO_Project;
extern alias Erp_Contracts_BO_Part;
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 **
private UD06Adapter _ud06Adapter;
private EpiDataView _edvJobHead;
private DataTable UD06_Column;
private EpiDataView _edvUD06;
private string _Key1UD06;
private string _Key2UD06;
private string _Key3UD06;
private string _Key4UD06;
private string _Key5UD06;
private DataView JobHead_DataView;
// 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
InitializeUD06Adapter();
this._Key1UD06 = string.Empty;
this._Key2UD06 = string.Empty;
this._Key3UD06 = string.Empty;
this._Key4UD06 = string.Empty;
this._Key5UD06 = string.Empty;
this.baseToolbarsManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.baseToolbarsManager_ToolClickForUD06);
this.JobEntryForm.BeforeToolClick += new Ice.Lib.Framework.BeforeToolClickEventHandler(this.JobEntryForm_BeforeToolClickForUD06);
this.JobEntryForm.AfterToolClick += new Ice.Lib.Framework.AfterToolClickEventHandler(this.JobEntryForm_AfterToolClickForUD06);
this.JobHead_Row.EpiRowChanged += new EpiRowChanged(this.JobHead_AfterRowChangeForUD06);
this.JobHead_DataView = this.JobHead_Row.dataView;
this.JobHead_DataView.ListChanged += new ListChangedEventHandler(this.JobHead_DataView_ListChangedForUD06);
this.JobHead_Row.BeforeResetDataView += new Ice.Lib.Framework.EpiDataView.BeforeResetDataViewDelegate(this.JobHead_BeforeResetDataViewForUD06);
this.JobHead_Row.AfterResetDataView += new Ice.Lib.Framework.EpiDataView.AfterResetDataViewDelegate(this.JobHead_AfterResetDataViewForUD06);
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// 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
if ((this._ud06Adapter != null))
{
this._ud06Adapter.Dispose();
this._ud06Adapter = null;
}
this._edvUD06 = null;
this._edvJobHead = null;
this.UD06_Column = null;
this._Key1UD06 = null;
this._Key2UD06 = null;
this._Key3UD06 = null;
this._Key4UD06 = null;
this._Key5UD06 = null;
this.baseToolbarsManager.ToolClick -= new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.baseToolbarsManager_ToolClickForUD06);
this.JobEntryForm.BeforeToolClick -= new Ice.Lib.Framework.BeforeToolClickEventHandler(this.JobEntryForm_BeforeToolClickForUD06);
this.JobEntryForm.AfterToolClick -= new Ice.Lib.Framework.AfterToolClickEventHandler(this.JobEntryForm_AfterToolClickForUD06);
this.JobHead_Row.EpiRowChanged -= new EpiRowChanged(this.JobHead_AfterRowChangeForUD06);
this.JobHead_DataView.ListChanged -= new ListChangedEventHandler(this.JobHead_DataView_ListChangedForUD06);
this.JobHead_DataView = null;
this.JobHead_Row.BeforeResetDataView -= new Ice.Lib.Framework.EpiDataView.BeforeResetDataViewDelegate(this.JobHead_BeforeResetDataViewForUD06);
this.JobHead_Row.AfterResetDataView -= new Ice.Lib.Framework.EpiDataView.AfterResetDataViewDelegate(this.JobHead_AfterResetDataViewForUD06);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void InitializeUD06Adapter()
{
// Create an instance of the Adapter.
this._ud06Adapter = new UD06Adapter(this.oTrans);
this._ud06Adapter.BOConnect();
// Add Adapter Table to List of Views
// This allows you to bind controls to the custom UD Table
this._edvUD06 = new EpiDataView();
this._edvUD06.dataView = new DataView(this._ud06Adapter.UD06Data.UD06);
this._edvUD06.AddEnabled = true;
this._edvUD06.AddText = "New UD06";
if ((this.oTrans.EpiDataViews.ContainsKey("UD06View") == false))
{
this.oTrans.Add("UD06View", this._edvUD06);
}
// Initialize DataTable variable
this.UD06_Column = this._ud06Adapter.UD06Data.UD06;
// Initialize EpiDataView field.
this._edvJobHead = ((EpiDataView)(this.oTrans.EpiDataViews["JobHead"]));
Erp.UI.FrameWork.JobLib.EpiDataViewRelation jobHeadUD06Relation = new Erp.UI.FrameWork.JobLib.EpiDataViewRelation(this._edvUD06);
Erp.UI.FrameWork.JobLib.EpiDataViewRelation jobRelation = new Erp.UI.FrameWork.JobLib.EpiDataViewRelation(this._edvJobHead);
// Set the parent view / keys for UD child view
string[] parentKeyFields = new string[3];
string[] childKeyFields = new string[3];
parentKeyFields[0] = "PartNum";
childKeyFields[0] = "Key1";
parentKeyFields[1] = "JobNum";
childKeyFields[1] = "Key2";
parentKeyFields[2] = "RevisionNum";
childKeyFields[2] = "Key3";
// Use SetParent not SetParentView
jobHeadUD06Relation.SetParent(jobRelation, parentKeyFields, childKeyFields);
// Magic Here
Erp.UI.FrameWork.JobLib.EpiDataViewFilterManager x = new Erp.UI.FrameWork.JobLib.EpiDataViewFilterManager(this.oTrans);
x.AddRelation(jobHeadUD06Relation);
if ((this.oTrans.PrimaryAdapter != null))
{
// this.oTrans.PrimaryAdapter.GetCurrentDataSet(Ice.Lib.Searches.DataSetMode.RowsDataSet).Tables.Add(this._edvUD06.dataView.Table.Clone())
}
}
private void GetUD06Data(string key1, string key2, string key3, string key4, string key5)
{
if ((this._Key1UD06 != key1) || (this._Key2UD06 != key2) || (this._Key3UD06 != key3) || (this._Key4UD06 != key4) || (this._Key5UD06 != key5))
{
// Build where clause for search.
string whereClause = "Key1 = \'" + key1 + "\' And Key2 = \'" + key2 + "\' And Key3 = \'" + key3 + "\' And Key4 = \'" + key4 + "\'";
System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
whereClauses.Add("UD06", whereClause);
// Call the adapter search.
SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
this._ud06Adapter.InvokeSearch(searchOptions);
if ((this._ud06Adapter.UD06Data.UD06.Rows.Count > 0))
{
this._edvUD06.Row = 0;
} else
{
this._edvUD06.Row = -1;
}
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
// Set key fields to their new values.
this._Key1UD06 = key1;
this._Key2UD06 = key2;
this._Key3UD06 = key3;
this._Key4UD06 = key4;
this._Key5UD06 = key5;
}
}
private void GetNewUD06Record()
{
DataRow parentViewRow = this._edvJobHead.CurrentDataRow;
// Check for existence of Parent Row.
if ((parentViewRow == null))
{
return;
}
if (this._ud06Adapter.GetaNewUD06())
{
string partnum = parentViewRow["PartNum"].ToString();
string jobnum = parentViewRow["JobNum"].ToString();
string revisionnum = parentViewRow["RevisionNum"].ToString();
// Get unique row count id for Key5
int rowCount = this._ud06Adapter.UD06Data.UD06.Rows.Count;
int lineNum = rowCount;
bool goodIndex = false;
while ((goodIndex == false))
{
// Check to see if index exists
DataRow[] matchingRows = this._ud06Adapter.UD06Data.UD06.Select("Key5 = \'" + lineNum.ToString() + "\'");
if ((matchingRows.Length > 0))
{
lineNum = (lineNum + 1);
} else
{
goodIndex = true;
}
}
// Set initial UD Key values
DataRow editRow = this._ud06Adapter.UD06Data.UD06.Rows[(rowCount - 1)];
editRow.BeginEdit();
editRow["Key1"] = partnum;
editRow["Key2"] = jobnum;
editRow["Key3"] = revisionnum;
editRow["Key4"] = string.Empty;
editRow["Key5"] = lineNum.ToString();
editRow.EndEdit();
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, (rowCount - 1), this._edvUD06.Column));
}
}
private void SaveUD06Record()
{
// Save adapter data
this._ud06Adapter.Update();
}
private void DeleteUD06Record()
{
// Check to see if deleted view is ancestor view
bool isAncestorView = false;
Ice.Lib.Framework.EpiDataView parView = this._edvUD06.ParentView;
while ((parView != null))
{
if ((this.oTrans.LastView == parView))
{
isAncestorView = true;
break;
} else
{
parView = parView.ParentView;
}
}
// If Ancestor View then delete all child rows
if (isAncestorView)
{
DataRow[] drsDeleted = this._ud06Adapter.UD06Data.UD06.Select("Key1 = \'" + this._Key1UD06 + "\' AND Key2 = \'" + this._Key2UD06 + "\' AND Key3 = \'" + this._Key3UD06 + "\' AND Key4 = \'" + this._Key4UD06 + "\'");
for (int i = 0; (i < drsDeleted.Length); i = (i + 1))
{
this._ud06Adapter.Delete(drsDeleted[i]);
}
} else
{
if ((this.oTrans.LastView == this._edvUD06))
{
if ((this._edvUD06.Row >= 0))
{
DataRow drDeleted = ((DataRow)(this._ud06Adapter.UD06Data.UD06.Rows[this._edvUD06.Row]));
if ((drDeleted != null))
{
if (this._ud06Adapter.Delete(drDeleted))
{
if ((_edvUD06.Row > 0))
{
_edvUD06.Row = (_edvUD06.Row - 1);
}
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
}
}
}
}
}
}
private void UndoUD06Changes()
{
this._ud06Adapter.UD06Data.RejectChanges();
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
}
private void ClearUD06Data()
{
this._Key1UD06 = string.Empty;
this._Key2UD06 = string.Empty;
this._Key3UD06 = string.Empty;
this._Key4UD06 = string.Empty;
this._Key5UD06 = string.Empty;
this._ud06Adapter.UD06Data.Clear();
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
}
private void baseToolbarsManager_ToolClickForUD06(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
// EpiMessageBox.Show(args.Tool.Key);
switch (args.Tool.Key)
{
case "EpiAddNewNew UD06":
GetNewUD06Record();
break;
case "ClearTool":
ClearUD06Data();
break;
case "UndoTool":
UndoUD06Changes();
break;
}
}
private void JobEntryForm_BeforeToolClickForUD06(object sender, Ice.Lib.Framework.BeforeToolClickEventArgs args)
{
// EpiMessageBox.Show(args.Tool.Key);
switch (args.Tool.Key)
{
case "SaveTool":
SaveUD06Record();
break;
}
}
private void JobEntryForm_AfterToolClickForUD06(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
{
// EpiMessageBox.Show(args.Tool.Key);
switch (args.Tool.Key)
{
case "DeleteTool":
if ((args.Cancelled == false))
{
DeleteUD06Record();
}
break;
}
}
private void JobHead_AfterRowChangeForUD06(EpiRowChangedArgs args)
{
// ** add AfterRowChange event handler
string partnum = args.CurrentView.dataView[args.CurrentRow]["PartNum"].ToString();
string jobnum = args.CurrentView.dataView[args.CurrentRow]["JobNum"].ToString();
string revisionnum = args.CurrentView.dataView[args.CurrentRow]["RevisionNum"].ToString();
GetUD06Data(partnum, jobnum, revisionnum, string.Empty, string.Empty);
}
private void JobHead_DataView_ListChangedForUD06(object sender, ListChangedEventArgs args)
{
// ** add ListChanged event handler
string partnum = JobHead_DataView[0]["PartNum"].ToString();
string jobnum = JobHead_DataView[0]["JobNum"].ToString();
string revisionnum = JobHead_DataView[0]["RevisionNum"].ToString();
GetUD06Data(partnum, jobnum, revisionnum, string.Empty, string.Empty);
}
private void JobHead_BeforeResetDataViewForUD06(object sender, EventArgs args)
{
// ** remove ListChanged event handler
this.JobHead_DataView.ListChanged -= new ListChangedEventHandler(this.JobHead_DataView_ListChangedForUD06);
}
private void JobHead_AfterResetDataViewForUD06(object sender, EventArgs args)
{
// ** reassign DataView and add ListChanged event handler
this.JobHead_DataView = this.JobHead_Row.dataView;
this.JobHead_DataView.ListChanged += new ListChangedEventHandler(this.JobHead_DataView_ListChangedForUD06);
}
}
I am trying to tap into GetUD06Data at the end to update my text box with the right value. I used a messagebox as an example until I can pull the right data in.
I placed some lines at the end of GetUD06Data:
private void GetUD06Data(string key1, string key2, string key3, string key4, string key5)
{
if ((this._Key1UD06 != key1) || (this._Key2UD06 != key2) || (this._Key3UD06 != key3) || (this._Key4UD06 != key4) || (this._Key5UD06 != key5))
{
// Build where clause for search.
string whereClause = "Key1 = \'" + key1 + "\' And Key2 = \'" + key2 + "\' And Key3 = \'" + key3 + "\' And Key4 = \'" + key4 + "\'";
System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
whereClauses.Add("UD06", whereClause);
// Call the adapter search.
SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
this._ud06Adapter.InvokeSearch(searchOptions);
if ((this._ud06Adapter.UD06Data.UD06.Rows.Count > 0))
{
this._edvUD06.Row = 0;
} else
{
this._edvUD06.Row = -1;
}
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
// Set key fields to their new values.
this._Key1UD06 = key1;
this._Key2UD06 = key2;
this._Key3UD06 = key3;
this._Key4UD06 = key4;
this._Key5UD06 = key5;
MessageBox.Show(this._edvUD06.Column.ToString()); // How to pull UD06.Number01 here instead?
//txtOJI.Value = this._edvUD06.Column.ToString();
}
}
Do I need to be setting the value of my text box directly like this? Shouldnāt the epibinding to UD06View.Number01 be enough?
I pulled up the Object Explorer and found a bit of code to pull the right value into my textbox (or messagebox). Here is the last part of my code with those updates:
// Notify that data was updated.
this._edvUD06.Notify(new EpiNotifyArgs(this.oTrans, this._edvUD06.Row, this._edvUD06.Column));
// Set key fields to their new values.
this._Key1UD06 = key1;
this._Key2UD06 = key2;
this._Key3UD06 = key3;
this._Key4UD06 = key4;
this._Key5UD06 = key5;
MessageBox.Show("Made it here!");
}
MessageBox.Show("Made it here too!");
EpiDataView edvOJI = (EpiDataView)(oTrans.EpiDataViews["UD06View"]);
int OJI = System.Convert.ToInt32(edvOJI.dataView[edvOJI.Row]["Number01"]);
MessageBox.Show("Got OJI!" + OJI.ToString());
txtOJI.Value = OJI.ToString();
}
In this case, after I type in a job number, I get a message for āMade it here!ā. Then I get two messages for āMade it here too!ā. But the āGot OJIā message never fires.
Donāt you hate it when everything looks like it should work!?
Perhaps I am asking the wrong questions here.
I keep thinking that my issue is linking between the Job Entry form and my UD06 table.
Is there a minimum requirement for linking to this form? Should I be linking to something other than JobHead? From what I can see in other posts, and in the manual, I am doing everything correctly.
I still havenāt seen anything that confirms my UD06 data is even synching up with the JobHead table. I can run a BAQ that links on JobNum, PartNum, and RevisionNum. So I know my fields have matching data.
I appreciate any ideas you have on this!
Thanks!
Nate