Recursive Job Assembly Validation

, ,

Hello Epic Users

In the Job Module I need to find the deepest recursive Subassembly and create a list, after I have the list I need to do a loop back up the hierarchy and check each level of the hierarchy to see if a particular UD check box is true, if it doesn’t find a checkbox that is true by the time it gets back to the top level it would then need to compile a list of the lowest level subassemblies that didn’t find a checkbox set as true

It’s a bit of a curly one but… does anyone have any bright ideas of where one would start?

I would prefer to do this in a BPM (or a BAQ Dashboard with row colours that identified the subassemblies that match the criteria above)

In the JobEntry object, there is a method called “GetDataSetForTree” that might be a good starting point for you.

1 Like

To do it purely in code feels a lot easier with recursive method calls, but you are only going to be able to use those in an external .dll or client side code. You should be able to determine the same thing with a BAQ with a CTE. It will be very similar to a recursive BOM (There’s a great example in the guide). From the result set of a recursive Job Assembly BAQ it would be easy to determine the lowest level.
So create a BAQ that give you a clean recursive Job Assembly list.
Run the BAQ in code and use a LINQ query on the BAQ results data table to pull the records that need to be modified. (You probably can make a BAQ that summarizes everything for you so you don’t need the LINQ query, but that makes my head hurt)

Thanks Mark and Carson, I’ve got a large customization that I’m trying to pull together, this is one small part that can wait until the end