Is there a method or function to get EpiGuid of all controls in Customization code ?
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);
}
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).
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";;
}
.......................
}
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.