PX script hangs during multi-level BOM change workflow in change management module

melissa_king
Tue, 20 May 2025 20:53:58 +0000

Classic recursion issue. Your script is likely hitting stack overflow or creating too many database queries. Each recursive call loads BOM lines from the database, and without caching, you’re making exponential queries. For an 8-level BOM with 10 components per level, that’s potentially 10^8 queries. You need to implement breadth-first traversal with batching instead of depth-first recursion.