Classic to Kinetic Upgrade Helper

We were struggling with identifying all screen changes that were done in classic when we are trying to re-create / convert to Kinetic.
The below function can be added at the End of any classic customization and invoked in InitializeCustom code it will run through all the custom or moved / changed controls and visually highlight them for you to make the changes easier to spot.

Simply add this at the bottom of your classic customization

private void ColorChange()
    {   
        
        foreach(System.Collections.DictionaryEntry controls in csm.PersonalizeCustomizeManager.ControlsHT)
        {
            if(csm.CustomCodeAll.Contains(controls.Key as String) && (controls.Value as IInfragisticsAppearance!=null))
            {
				 // Color and Style Hidden Controls
                 if(!((Control)controls.Value).Visible)
                 {
                    ((Control)controls.Value).Visible = true;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BorderColor=System.Drawing.Color.SpringGreen;                   
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColorDisabled = System.Drawing.Color.SpringGreen;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColorDisabled2 = System.Drawing.Color.SpringGreen;
                    ((IInfragisticsAppearance)controls.Value).Appearance.ForeColor = System.Drawing.Color.Black;
                    ((IInfragisticsAppearance)controls.Value).Appearance.ForeColorDisabled = System.Drawing.Color.Black;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColor = System.Drawing.Color.SpringGreen;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColor2 = System.Drawing.Color.SpringGreen;
                    if(controls.Value as Infragistics.Win.UltraControlBase!=null)
                    {
                        ((Infragistics.Win.UltraControlBase)controls.Value).UseOsThemes=Infragistics.Win.DefaultableBoolean.False;
                        ((Infragistics.Win.UltraControlBase)controls.Value).UseAppStyling=false;
                    }
                    EpiTextBox txtNew = new EpiTextBox();
                    txtNew.Appearance.BorderColor=System.Drawing.Color.SpringGreen;
					txtNew.Appearance.BackColor = System.Drawing.Color.SpringGreen;
					txtNew.Appearance.BackColor2 = System.Drawing.Color.SpringGreen;
					txtNew.UseAppStyling=false;
					txtNew.UseOsThemes=Infragistics.Win.DefaultableBoolean.False;;
                    txtNew.Text="<-- Hidden";
                    Control parent = ((Control)controls.Value).Parent;
                    txtNew.Location= ((Control)controls.Value).Location;
                    txtNew.Left=txtNew.Left+((Control)controls.Value).Width;
                    txtNew.Width = 65;
                    parent.Controls.Add(txtNew);
                    txtNew.BringToFront();
                 }
				 // Color and style native controls that have been moved/modified/changed
                 else{
                    ((IInfragisticsAppearance)controls.Value).Appearance.BorderColor=System.Drawing.Color.Bisque;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColorDisabled = System.Drawing.Color.Bisque;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColorDisabled2 = System.Drawing.Color.Bisque;
                    ((IInfragisticsAppearance)controls.Value).Appearance.ForeColor = System.Drawing.Color.DodgerBlue;
                    ((IInfragisticsAppearance)controls.Value).Appearance.ForeColorDisabled = System.Drawing.Color.DodgerBlue;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColor = System.Drawing.Color.Bisque;
                    ((IInfragisticsAppearance)controls.Value).Appearance.BackColor2 = System.Drawing.Color.Bisque;
                    if(controls.Value as Infragistics.Win.UltraControlBase!=null)
                    {
                        ((Infragistics.Win.UltraControlBase)controls.Value).UseOsThemes=Infragistics.Win.DefaultableBoolean.False;
                        ((Infragistics.Win.UltraControlBase)controls.Value).UseAppStyling=false;
                    }
                 }
            }
        }
        foreach(System.Collections.DictionaryEntry control in csm.CustomControlDictionary)
        {
			// Color and style custom controls
            if(control.Value as IInfragisticsAppearance!=null)
            {
                ((IInfragisticsAppearance)((System.Collections.DictionaryEntry)control).Value).Appearance.BorderColor=System.Drawing.Color.LemonChiffon;
                ((IInfragisticsAppearance)control.Value).Appearance.BorderColor=System.Drawing.Color.LemonChiffon;
                ((IInfragisticsAppearance)control.Value).Appearance.BackColorDisabled = System.Drawing.Color.LemonChiffon;
                ((IInfragisticsAppearance)control.Value).Appearance.BackColorDisabled2 = System.Drawing.Color.LemonChiffon;
                ((IInfragisticsAppearance)control.Value).Appearance.ForeColor = System.Drawing.Color.Coral;
                ((IInfragisticsAppearance)control.Value).Appearance.ForeColorDisabled = System.Drawing.Color.Coral;
                ((IInfragisticsAppearance)control.Value).Appearance.BackColor = System.Drawing.Color.LemonChiffon;
                ((IInfragisticsAppearance)control.Value).Appearance.BackColor2 = System.Drawing.Color.LemonChiffon;
                if(control.Value as Infragistics.Win.UltraControlBase!=null)
                {
                    ((Infragistics.Win.UltraControlBase)control.Value).UseOsThemes=Infragistics.Win.DefaultableBoolean.False;
                    ((Infragistics.Win.UltraControlBase)control.Value).UseAppStyling=false;
                }
            
            }
        }
        
    }

Then at the end of InitializeCustomCode invoke the fuction

ColorChange();

The resulting screen will look like this

Orange/Blue Text = Native controls that have been moved/modified/changed
Yellow/Coral Text = Custom Controls
Green = A hidden control these controls also get a special ← arrow pointing to them cause they are ā€œnewā€ and may be missed. We turned them from ā€œhiddenā€ to ā€œvisibleā€ and higlight them in green.

Hope this helps

image001.jpg

6 Likes

Edit: Never mind. It was my mess up!

Thanks again Jose!

Jose, this is fantastic! Makes it a lot easier to see the changes. I like that it shows the hidden items too. Thanks for doing this!

// **************************************************
// Custom code for myChosenForm
// Created: 03/08/2022 09:26:30
// **************************************************

using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.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;

using System.IO;

public class Script
{
.
.
.
}

Using the ā€œKinetic Upgrade Helperā€ Script, am wondering if there is a way to write the text content of the Script Object to file.

I am able to do the following, which writes details of a chosen control (or iterated controls) into a file, but am looking to write the whole script as depicted above into a file (to help me merge multiple versions of specific customizations into one, when going through the manual process of converting every customization).

string ctlType = ((Control)controls.Value).GetType().ToString();

File.WriteAllText (@"C:\Path\"+oTrans.EpiBaseForm.Name +"-"+ oTrans.EpiBaseForm.CustomizationName+".txt", ctlType);

You can just hit Ctrl S on the Script and it will save that to a file for you.

Many thanks Jose,

The reason for seeking the supposed sleek process is for me to write relevant properties of changed controls including EpiBindings as well as the custom script into a file (one per customization), so I could use tools like notepad++ to compare and merge customizations before selectively moving relevant versions to Kinetic.

Though I could open the saved file (saved by the edited ā€œKinetic Upgrade Helperā€ Script) and paste the content of Script.

The Grab Custom Controls on forms solution will be over kill for my needs, plus harder to compare the various versions of customizations (volume and xml tags).

Many thanks for the original solution as well.

Absolute LIFESAVER. Thank god for this post. Cannot put into words how much pain and suffering the script prevented.

EpiUsers should archive ā€œGame Changerā€ or ā€œHall of Fameā€ posts like these in a special category, under Categories.

I’m new to Epicor, so posts like this are game changers.

Thanks for this @josecgomez !

Thanks @josecgomez … It helps! But boy what an ugly manual process. :face_vomiting:

FOLLOWUP QUESTION: Is there a trick to get the changes made in Application Studio to be reflected on the Kinetc UX? I save my changes and publish yet they only show up when using the Preview option.

You need to attach the layer to the Menu.

Hmmm… I’m curious about what you’re saying here. That sounds like how we did layer customizations in the client. Since I’m editing that layer, how do I tell Kenetic – isn’t it the same?

The Initial Customizations layer shown below in the Application Studio is from the classic client and is also what we clicked here to edit the Kinetic UX and published. It sounds like you’re saying I’m missing another step?

Yes, you still have to edit menu items to use layers. Otherwise you could only ever have one customization per app type.

Edit: You have it pictured in your last screenshot, bottom right. ā€œKinetic Customizationā€ need to fill that out

Bam! This … thanks all!

… is there any easier way to edit ALL MENU TREE Kinetic Customization values that use Part Entry vs. one by one?