While validating usage link attributes SavePartUsesSubCommandDelegate.validateUsageLink(TypeInstance var1), isQtyUnitAttributeChanged(AttributeContainer var0, AssociationIdentifier var1) method should return the comparison result based on previous value and current value.
Hence getting Exception "Occurrences exist that must be removed before the unit can be changed" while updating usage link attributes programatically.
FileName: \com\ptc\core\foundation\occurrence\server\impl\SavePartUsesSubCommandDelegate.java
\com\ptc\core\foundation\occurrence\common\OccurrenceHelper.class
i.e.
Previous QtyUnit = 'EACH' Current QtyUnit = 'EACH'
if previousQtyUnit.equals(currentQtyUnit) then
return 'FALSE'
Else
return 'TRUE'
As per current implementation method returns TRUE even if no QtyUnit is updated.
if currentQtyUnit != null then
return 'TRUE'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.