When attempting to inactivate an item the following script runs:
select (select COUNT(PPN_I) from BM010115 where PPN_I='My Item Number' or CPN_I='My Item Number')+ (select COUNT(PPN_I) from PK010033 where PPN_I='My Item Number' or ITEMNMBR='My Item Number' and MANUFACTUREORDERST_I<>8)
For our item this returns >0 and fails returning the error "This item is part of an active assembly and cannot be marked inactive.". The count is > 0 because of rows in PK010033 where PPN_I='My Item Number' even though MANUFACTUREORDERST_I=8 for those rows.
Does this mean that we can't inactivate an item if it has ever been produced? Otherwise shouldn't the code be something like the following?:
select (select COUNT(PPN_I) from BM010115 where PPN_I='My Item Number' or CPN_I='My Item Number')+ (select COUNT(PPN_I) from PK010033 where (PPN_I='My Item Number' or ITEMNMBR='My Item Number') and MANUFACTUREORDERST_I<>8)