That was the main error in my code. BEL.LEV_VECKA is a field that isn’t used and not populated with data, so it is just confusing. It should be BEH.LEV_VECKA.

Then I also realized that RebuildAllConstraints must be sent to a DD, I didn’t understand that from the help text.

Concerning ItemGroup which is both on the OrderLine, Item and ItemGroup file, it seems to work independently where the constraint is located. I have always put them on the main file (OrderLine), but should they be on the uppermost file (ItemGroup)?

Bengt