I am seeing many duplicate entries of the same method in the Form Event Wizard list, not sure how or why they are there. Is that list built up dynamically from the existing code? Is there a cache file or something that is corrupt? If I select the different entries, they all display the same code, and the same field is listed in Fields combobox. Not the end of the world, but would be nice to clean it up or at least understand why it looks that way.
The code only has a single switch âcaseâ, checking against CommitmentDate_c.
private void PODetail_AfterFieldChange(object sender, DataColumnChangeEventArgs args)
{
int poLineNum = Convert.ToInt32(args.Row["POLine"]);
DateTime? commitmentDate = GetDate(args.Row["CommitmentDate_c"]);
// ** Argument Properties and Uses **
// args.Row["FieldName"]
// args.Column, args.ProposedValue, args.Row
// Add Event Handler Code
switch (args.Column.ColumnName)
{
case "CommitmentDate_c":
//When the PO detail commitment date changes
//NOTE: When editing the header, ignore the changes to the PO Detail commitment dates
if (!IsPoOpen()) return;
//Check if the end-user was editing the PO header
if(!isPOHeader_AfterFieldChange && IsPoOpen())
{
//If not, then prepare to process PO releases
//Check if there are open PO releases for this PO line
if(edvPORel.dataView.Table.Select(String.Format("POLine = {0} and OpenRelease = 1", args.Row["POLine"])).Length > 0){
//When there are existing releases, prompt the user to cascade the value to the PO releases
var dialogResult = ShowFieldMessageBox("Commitment Date", "Do you want to refresh all the open releases with the changes?");
//Check if the user has selected "Yes"
if(dialogResult == DialogResult.Yes){
//NOTE: During testing, it appeared that logic within the oTrans object would would prevent the PORelease changes from being committed
//NOTE: To workaround the commit issue, save the PODetail changes using oTrans.Update prior to updating the releases
//Save the change to PODetail.CommitmentDate_c
oTrans.Update();
//Update the PO releases for the current line item
SetPORelCommitmentDates(commitmentDate, poLineNum);
}
}
}
break;
}
}
I tried making duplicate entries for private void OrderHed_AfterFieldChange(object sender, DataColumnChangeEventArgs args), with separate Caseâs in each.
Out of curiosity, does the form GUI change when you go in to customisation mode? I have a few handheld screen s where this happens and custom code just dissapears, but if you look at the XML you are duplicate script entries, wondering if it is some function of that.
I have seen it in 10.1.500 and in 10.2.300 on Sales Order Entry and in 10.2.300 I can always replicate it by simply going to Order Entry and adding BeforeFieldChange
If you do Debug you can see 3 Event Listeners on this.OrderDtl_Column, 1 is your Method the other 2 are WatchedView_ColumnChanging (ChgLog) â Perhaps Epicor is getting a bit confused and assuming you have 3 and not 1.
If you update 1 in the Wizard, they all update, definitely a Display Bug however Epicor Enumerates the list.
âProd Code: âICE3â - On the Form Event Wizard when selecting event handlers to view or edit the combo boxes on the left do not always show the correct data. For scr 153877 a few of these issues were fixed. However a couple still remain. For the Retrieve event type the correct toolbar button is not selected.For the BeforeFieldChange and AfterFieldChange the correct field is not selected.â
The case is closed complete but a few still remain⌠Maybe those are Easter Eggs?