I inherited someone’s Dashboard and am being asked to fix the Clear button on the tracker portion of the dashboard. They claim that it used to work but now it does nothing when clicked. All that I actually need it to do is to execute a Refresh All (like pressing the white circle icon along the top). Can someone help me figure out how to make this button do that? Thank you!
This is the code that is there in Script Editor when Customizing the Tracker.
// **************************************************
// Custom code for 54f2113e-302e-4539-a2f1-3c3b68881bcf
// Created: 7/24/2020 2:12:04 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.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 static 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 **
public static 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
Script.clearButton.Click += new System.EventHandler(Script.clearButton_Click);
// End Wizard Added Custom Method Calls
}
public static void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
Script.clearButton.Click -= new System.EventHandler(Script.clearButton_Click);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private static void clearButton_Click(object sender, System.EventArgs args)
{
/*
txtUD01_DiameterCode_c.Value = "";
txtUD01_LeadCode_c.Value = "";
txtUD01_Hand_c.Value = "";
txtUD01_epicorPN_c.Value = "";
*/
}
}
MainController.AppControlPanel.HandleToolClick(RefreshTool, new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools[RefreshTool], null));
I tried changing it to that but I get this when trying to compile the dashboard:
## System Information ##
==================
AppServer Connection: net.tcp://xxxxxxx/ERP102700-Live
Form Name: Dashboard
Customization Name:
Menu ID:
Software Version: 3.2.700.40
============
Application Error
## Error Detail ##
============
##!Message:##! --------compile errors------------
Error: CS0117 - line 1022 (1021) - 'Ice.UI.App.ScrewThreadMaster.MainController' does not contain a definition for 'AppControlPanel'
Error: CS0117 - line 1022 (1021) - 'Ice.UI.App.ScrewThreadMaster.MainController' does not contain a definition for 'MainToolManager'
** Compile Failed. **
##!Program:##!
##!Method:##!
I tried changing it to that, but when I do I get these errors when trying to compile the dashboard:
## System Information ##
==================
AppServer Connection: net.tcp://xxxxxxxx/ERP102700-Live
Form Name: Dashboard
Customization Name:
Menu ID:
Software Version: 3.2.700.40
============
Application Error
## Error Detail ##
============
##!Message:##! --------compile errors------------
Error: CS0117 - line 1022 (1021) - 'Ice.UI.App.ScrewThreadMaster.MainController' does not contain a definition for 'AppControlPanel'
Error: CS0103 - line 1022 (1021) - The name 'RefreshTool' does not exist in the current context
Error: CS0117 - line 1022 (1021) - 'Ice.UI.App.ScrewThreadMaster.MainController' does not contain a definition for 'MainToolManager'
Error: CS0103 - line 1022 (1021) - The name 'RefreshTool' does not exist in the current context
** Compile Failed. **
##!Program:##!
##!Method:##!
You aren’t trying to do the customization in the dashboard maintenance are you? This won’t work there. You need to go into the customization on the deployed dashboard.
It’s because it doesn’t have access to the rest of the form. Only what’s in the tracker window. The refresh or clear button is out of the scope of that customization.