Form Customization - Duplicate Entries in Form Event Wizard

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.

image

Thanks

Does each of those correspond to a different field being monitored?

Or is each of those first 4 PODetail_AfterFieldChange, monitoring the field “CommitmentDate_c”?

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

EDIT: Tested this, is not the issue.

Just realized, I wonder if there is a parser that generates that list, and it is finding the variables that contain the method name.

isPOHeader_AfterFieldChange, for example.

Will check into it.

I just checked in version 10.1.400 and adding additional fields to monitor, doesn’t create more entries in the listbox

I tried making duplicate entries for private void OrderHed_AfterFieldChange(object sender, DataColumnChangeEventArgs args), with separate Case’s in each.

And all that does is generate an error upon opening the customization.

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

Note it only does it on certain tables like OrderDtl for example.

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.

2 Likes

Maybe PRB0097656?

“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?

A third class of software? The first two being Bug, and Feature. Now we have “Easter Egg”

“ERP Easter Egg” - functionality that appears as a bug, is called a feature, but provides no degradation or enhancement to the software.

1 Like