How would one successfully deploy a Dashboard to MES? We are on version 10.2.500.33. I’m following the guide on the built-in Application Help in combination with some posts on the forum and having no luck so far…
Thanks in advance!
How would one successfully deploy a Dashboard to MES? We are on version 10.2.500.33. I’m following the guide on the built-in Application Help in combination with some posts on the forum and having no luck so far…
Thanks in advance!
How far are you?
You will need to launch MES in customization mode.
This is from the Epicor ERP Customization UserGuide Chapter 4 Advanced Customization (Create MES Developer Icon)
This is from memory so the steps might be different.
Once you are in developer mode.
right click and select customization
save as just to make sure you are in a new layer
Add button
add code on button click
this is an example to call a dashboard
private void btnETKBOM_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
ProcessCaller.LaunchForm(MESMenu, "PMEDBR6");
}
Hi knash,
I am actually that far already, but the button still doesn’t show up or launch the dashboard. Notice that the line of code in my Click event code is the same as yours. Is there something else wrong with my code?
// **************************************************
// Custom code for MESMenu
// Created: 12/21/2021 1:22:27 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 btnLaunchSerialPrint;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
btnLaunchSerialPrint = (EpiButton)csm.GetNativeControlReference("fe187107-b719-4a3d-96a8-5f8505ea65ae");
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
// End Wizard Added Custom Method Calls
this.btnLaunchSerialPrint.Click += new System.EventHandler(this.btnLaunchSerialPrint_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.btnLaunchSerialPrint.Click -= new System.EventHandler(this.btnLaunchSerialPrint_Click);
}
private void MESMenu_Load(object sender, EventArgs args)
{
btnLaunchSerialPrint.ReadOnly = false;
}
private void btnLaunchSerialPrint_Click(object sender, System.EventArgs args)
{
ProcessCaller.LaunchForm(MESMenu, "UDMES1");
}
}
i have the enable code all in the form load for that button.
private void MESMenu_Load(object sender, EventArgs args)
{
////
//// Add Event Handler Code
////
btnSerialMatching = (EpiButton)csm.GetNativeControlReference("fe187107-b719-4a3d-96a8-5f8505ea65ae");
btnSerialMatching.ReadOnly = false;
}
hang on its a bit more complicated.
private EpiButton withEventsField_btnSerialMatching;
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
// 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
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void btnSerialMatching_Click(object Sender, EventArgs args)
{
ProcessCaller.LaunchForm(MESMenu, "WIP01");
}
private EpiButton btnSerialMatching
{
get
{
return withEventsField_btnSerialMatching;
}
set
{
if (withEventsField_btnSerialMatching != null)
{
withEventsField_btnSerialMatching.Click -= btnSerialMatching_Click;
}
withEventsField_btnSerialMatching = value;
if (withEventsField_btnSerialMatching != null)
{
withEventsField_btnSerialMatching.Click += btnSerialMatching_Click;
}
}
}
private void MESMenu_Load(object sender, EventArgs args)
{
////
//// Add Event Handler Code
////
btnSerialMatching = (EpiButton)csm.GetNativeControlReference("fe187107-b719-4a3d-96a8-5f8505ea65ae");
btnSerialMatching.ReadOnly = false;
}
This fixed it in combination with deleting the default MES.NotUsed EpiBinding on the button.
However, now I have a follow up question. The MES Menu customization that I have created to launch the dashboard, how do I set that as the default customization to be applied when loading MES?
Thanks for the help Ken!
You need to update the sysconfig file.
For Reference you can do what Epicor does.
this.oTrans.MESControlView.dataView.Table.Columns.Add("UD_MassIssue", typeof(bool));
this.oTrans.MESControlView.dataView.Table.Columns["UD_MassIssue"].ExtendedProperties.Add("MenuID", "XISSUTST"); // XISSUTST is the Menu or Process ID from Menu Maintenance
//Not sure if you need MESTab, cant remember what I was doing in this snippet
this.oTrans.MESControlView.dataView.Table.Columns["UD_MassIssue"].ExtendedProperties.Add("MESTab", "XISSUTST"); // XISSUTST is the Menu or Process ID from Menu Maintenance
this.oTrans.MESControlView.dataView[0]["UD_MassIssue"] = false;
By simply adding a Field to the Table and using Extended Property it will handle the Click of that button once you bind the button to that newly made column.
Been a while; throwing out for reference. Either way works. The main difference is one is easier to control with Row Rules.
Yes, I do know that I have to modify the sysconfig file with the custom MES MenuID, but my question is where would I find the menu item to apply the customization to in Menu Maintenance? Would I just create a new menu item, select the MES Menu program, and call that MenuID in the sysconfig file?
If you have a Menu already you can use it. If not I would make it under Processes so its basically a hidden Menu. Yes, you need to make it via Menu Maintenance first.
Thanks Haso! I appreciate the help.