Tree ExpandAll Job tracker with subassemblies

(Bruce Ordway) #1

Wonder if anyone has an example they can share of using GetDataSetForTree in a Job form customization? I recently ran into the same issue referenced in the old post.

Continuing the discussion from Expanding Job Entry Tree:

After starting to use more subassemblies have noticed that ExpandAll is only working for assembly zero in the method tree.

I used BLTester to get the general idea of what GetDataSetForTree does.
But I haven’t had much luck applying it in a form customization.


(Gregory Whiteford) #2

Hi Bruce, I have a question for you on a whole different issue. I made a post into your chain regarding recursive BOM structures in BAQ. I cannot get the revision subqueries to come out correctly. Would you be able to give me some pointers?

(Jose C Gomez) #3

Try this

MethodInfo miT = typeof(Convert).GetMethod("FromBase64String", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
byte[] arr = (byte[])miT.Invoke(null,new object[]{"am9iVHJlZQ=="});
FieldInfo fi = oTrans.GetType().GetField(Encoding.UTF8.GetString(arr),BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
MethodTree mt = (MethodTree) fi.GetValue(oTrans);
arr = (byte[])miT.Invoke(null,new object[]{"Y21FeHBhbmRUcmVl"});
MethodInfo mi = mt.GetType().GetMethod(Encoding.UTF8.GetString(arr), BindingFlags.NonPublic | BindingFlags.Instance);
mi.Invoke(mt, new object[]{this, new EventArgs()});

(Bruce Ordway) #4

BOM structures in BAQ… revision subqueries… pointers
Sure… rather than trying to explain in posts…
Let’s see if you can access this link to GDrive

Shared (I hope) a basic BAQ example - indents a BOM while picking the latest active revs

(Gregory Whiteford) #5

Bruce. I am having trouble getting the files to download. It locks up my browser…

(Bruce Ordway) #6

locks up
OK, can you let me know if you have some place where I can upload or email the file

(Gregory Whiteford) #7

Thanks Bruce! I got it to download. I will see if I can bring it into BAQ!

(Gregory Whiteford) #8

There is a delay in these emails. Thank you so much for the help! Got it downloaded without a problem!

(Bruce Ordway) #9

Thanks for the reply Jose.
The example doesn’t seem to like this line so far:
Error ‘MethodTree’ could not be found (missing a using,assembly ref?)
Will keep digging…

FYI… here is the existing code… (kind of working except only parses assembly 0)
try {
// Note that Epicor assigns a different GUID each time the form loads
Ice.Lib.Framework.JobLib.MethodTree mt = default(Ice.Lib.Framework.JobLib.MethodTree);
FieldInfo fi = default(FieldInfo);
Ice.Lib.Framework.JobLib.MethodTreePanel tvp = default(Ice.Lib.Framework.JobLib.MethodTreePanel);
fi = typeof(Erp.UI.App.JobTracker.JobTrackerForm).GetField(“jobTreeViewPanel”, BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
tvp = (Ice.Lib.Framework.JobLib.MethodTreePanel) fi.GetValue(JobTrackerForm);
mt = tvp.MethodTree;
// ExpandAll is only parsing assebmly zero… how do I call GetDataSetForTree first?
catch (Exception ex)
MessageBox.Show("Expand Tree Error: " + ex.Message);