How to get EpiGuid of all controls

Is there a method or function to get EpiGuid of all controls in Customization code ?

image

Try this:

List<Guid> myGuids = new List<Guid>();
foreach (Control x in this.Controls)
{
   myGuids.Add(x.EpiGuid);
}

If the Guid is a string, then:

List<string> myGuids = new List<string>();
foreach (Control x in this.Controls)
{
   myGuids.Add(x.EpiGuid);
}
1 Like

Thanks for your help, but it is not feasible in custom code, now I have solved my problem by other resolutions, thanks again.

Did the code not work or did your solution not accomplish the requirement?

Yes, it does not work with error: ‘System.Windows.Forms.Control’ does not contain a definition for ‘EpiGuid’ and no extension method ‘EpiGuid’ accepting a first argument of type ‘System.Windows.Forms.Control’ could be found (are you missing a using directive or an assembly reference?)

Ah. I guess you would have to get the type of it first… Oh well.

In the customized form, go to Tools > Custom XML Editor. It gives a grid you can “Copy to Excel” (you know, right-click it, like any grid in Epicor).

1 Like

But my want to know how to reference the keys of these controls in custom coding, now I got it using the following coding, share it for your reference,
Here is got all Textbox controls key from a groupbox control:

         Ice.Lib.Framework.EpiGroupBox pnl = (Ice.Lib.Framework.EpiGroupBox)csm.GetNativeControlReference("810241f6-e91e-4112-be62-f77982737f3c");
      foreach (Control c in pnl.Controls)
        {   
          if (c.GetType() == typeof(EpiTextBox))
            {
                Ice.Lib.Framework.EpiTextBox c1 = (Ice.Lib.Framework.EpiTextBox)c;
                this.txtList1.Text += c1.EpiGuid + "\r\n";;
            } 
             .......................
        }
2 Likes

If it is a custom control, you can reference it by name. Otherwise:

EpiTextBox tbMyField = (EpiTextBox)csm.GetNativeControlReference("2dcd1674-5e34-4d98-b493-c75747027376");

Yes, you’re right, but if want to get multiple controls, maybe can consider my coding, or you have a better way to share, thanks.