Modify a second MES button, Part Two

I’ve modified one of the existing buttons on our classic MES screen to open a dashboard using this knowledge base article:
KB0029127
And it works properly. Now I’m trying to modify a second button on the supervisor tab for time and expense entry but I can’t get a second button to work. These are existing blank MES buttons, not ones I’ve made myself.
I can enable the button but in the script editor I only seem to get one set of codes for one button. I’m sure that somehow I need to identify the second button and set its launchform to the correct menu ID. I just can’t seem to figure that part out. I did a search and tried following the steps here but my buttons don’t show up in the form event wizard
Here’s my code. I’m sure I’m missing a simple step somewhere. I’m going to bed now, I’ve been working too long on this tonight.
TIA

// Custom code for MESMenu
// Created: 5/10/2023 4:09:49 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
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 **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **
EpiButton btnDash;


	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

btnDash = (EpiButton)csm.GetNativeControlReference("fe187107-b719-4a3d-96a8-5f8505ea65ae");

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		SetExtendedProperties();
		// End Wizard Added Custom Method Calls

this.btnDash.Click += new System.EventHandler(this.btnDash_Click);
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal

this.btnDash.Click -= new System.EventHandler(this.btnDash_Click);
	}

	private void MESMenu_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
	
	 btnDash.ReadOnly = false;
	
	}




private void btnDash_Click(object sender, System.EventArgs args)

{

ProcessCaller.LaunchForm(this.oTrans, "UDJOBDB1");

}


	private void SetExtendedProperties()
	{
		// Begin Wizard Added EpiDataView Initialization
		EpiDataView edvLaborDtl = ((EpiDataView)(this.oTrans.EpiDataViews["LaborDtl"]));
		// End Wizard Added EpiDataView Initialization

		// Begin Wizard Added Conditional Block
		if (edvLaborDtl.dataView.Table.Columns.Contains("Complete"))
		{
			// Begin Wizard Added ExtendedProperty Settings: edvLaborDtl-Complete
			edvLaborDtl.dataView.Table.Columns["Complete"].ExtendedProperties["ReadOnly"] = true;
			// End Wizard Added ExtendedProperty Settings: edvLaborDtl-Complete
		}
		if (edvLaborDtl.dataView.Table.Columns.Contains("OpComplete"))
		{
			// Begin Wizard Added ExtendedProperty Settings: edvLaborDtl-OpComplete
			edvLaborDtl.dataView.Table.Columns["OpComplete"].ExtendedProperties["ReadOnly"] = true;
			// End Wizard Added ExtendedProperty Settings: edvLaborDtl-OpComplete
		}
		// End Wizard Added Conditional Block
	}
}```

I’m going to bump this back up to see if anyone has any ideas.
Thanks

I would just put a custom button over the button and bring that to the front over the native button if it is giving you problems. Then just use the event wizard for the custom button click event.

I figured it out this morning. It’s just a matter of duplicating all the lines of code for the first button and naming the second one “btnDash2”
For anyone else wanting to try this here is my code for 2 buttons. You can copy it and change the Guid and Menu ID.
Sometimes just walking away from a problem for a bit can help find the solutions.

// Custom code for MESMenu
// Created: 5/10/2023 4:09:49 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
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 **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **
EpiButton btnDash;
EpiButton btnDash2;


	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

btnDash = (EpiButton)csm.GetNativeControlReference("fe187107-b719-4a3d-96a8-5f8505ea65ae");
btnDash2 = (EpiButton)csm.GetNativeControlReference("b2e660e3-2ead-45df-8389-f451989fa103-1");

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		SetExtendedProperties();
		// End Wizard Added Custom Method Calls

this.btnDash.Click += new System.EventHandler(this.btnDash_Click);
this.btnDash2.Click += new System.EventHandler(this.btnDash2_Click);
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal

this.btnDash.Click -= new System.EventHandler(this.btnDash_Click);
this.btnDash2.Click -= new System.EventHandler(this.btnDash2_Click);
	}

	private void MESMenu_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
	
	 btnDash.ReadOnly = false;
     btnDash2.ReadOnly = false;
	
	}




private void btnDash_Click(object sender, System.EventArgs args)

{

ProcessCaller.LaunchForm(this.oTrans, "UDJOBDB1");

}
private void btnDash2_Click(object sender, System.EventArgs args)

{

ProcessCaller.LaunchForm(this.oTrans, "JCGO3002");

}


	private void SetExtendedProperties()
	{
		// Begin Wizard Added EpiDataView Initialization
		EpiDataView edvLaborDtl = ((EpiDataView)(this.oTrans.EpiDataViews["LaborDtl"]));
		// End Wizard Added EpiDataView Initialization

		// Begin Wizard Added Conditional Block
		if (edvLaborDtl.dataView.Table.Columns.Contains("Complete"))
		{
			// Begin Wizard Added ExtendedProperty Settings: edvLaborDtl-Complete
			edvLaborDtl.dataView.Table.Columns["Complete"].ExtendedProperties["ReadOnly"] = true;
			// End Wizard Added ExtendedProperty Settings: edvLaborDtl-Complete
		}
		if (edvLaborDtl.dataView.Table.Columns.Contains("OpComplete"))
		{
			// Begin Wizard Added ExtendedProperty Settings: edvLaborDtl-OpComplete
			edvLaborDtl.dataView.Table.Columns["OpComplete"].ExtendedProperties["ReadOnly"] = true;
			// End Wizard Added ExtendedProperty Settings: edvLaborDtl-OpComplete
		}
		// End Wizard Added Conditional Block
	}
}