Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I get "Adjustment of Production Quantity Failed" error on Operator Dashboard when I want to add "1" to OK quantity, where the counter is already "0".
Related script error:
"MnfgCommonProductionEventManagementThingShape - AdjustProductionQuantity_PRD: AdjustProductionQuantity failed with Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
Solved! Go to Solution.
Hi Oaslan
Check in the Configuration -> Equipment screen, on that equipment, in the Attributes tab. You should have 1 Attribute with type Production Event Quantity and (optional, for waste) one for Waste Event Quantity.
This error indicates two suspects, you should see 1 of them in that screen
- One of the Attributes has more than 1 type. This cannot be done in the screen but can be accomplished via other ways, usually the Excel configuration import.
- There is more than 1 Attribute with the same type (Production Event Quantity).
However sadly the only way to solve this is via an SQL query, there is no screen or button to fix it. First, use this query to get the results of what currently exists :
SELECT e.uid 'EquipmentUid', e.name 'EquipmentName', e.displayname 'EquipmentDisplayname',
a.uid 'AttributeUid', a.name 'AttributeName', a.displayname 'AttributeDisplayname',
att.uid 'AttributeTypeUid', att.displayname 'AttributeTypeDisplayname', atl.Uid 'AttributeTypeLinkUid'
FROM equipment e
JOIN attribute a ON a.equipmentuid = e.uid
LEFT
JOIN attributetypelink atl ON atl.attributeuid = a.uid
LEFT
JOIN attributetype att ON att.uid = atl.attributetypeuid
-- WHERE e.name = '' -- You can add the equipment name here as a filter
ORDER
BY e.displayname ASC,
a.displayname ASC,
att.displayname ASC
With this query, we need to find the AttributeLinkUid(s) that we want to remove, in order to satisfy the 2 rules above. To delete the bad record(s), you can use the following query and change the Uid in the script, using the AttributeTypeLinkUid column from the 1st query (should be the last column on the right).
DELETE FROM attributetypelink WHERE uid = ENTER_NUMBER_HERE
Hi Oaslan
Check in the Configuration -> Equipment screen, on that equipment, in the Attributes tab. You should have 1 Attribute with type Production Event Quantity and (optional, for waste) one for Waste Event Quantity.
This error indicates two suspects, you should see 1 of them in that screen
- One of the Attributes has more than 1 type. This cannot be done in the screen but can be accomplished via other ways, usually the Excel configuration import.
- There is more than 1 Attribute with the same type (Production Event Quantity).
However sadly the only way to solve this is via an SQL query, there is no screen or button to fix it. First, use this query to get the results of what currently exists :
SELECT e.uid 'EquipmentUid', e.name 'EquipmentName', e.displayname 'EquipmentDisplayname',
a.uid 'AttributeUid', a.name 'AttributeName', a.displayname 'AttributeDisplayname',
att.uid 'AttributeTypeUid', att.displayname 'AttributeTypeDisplayname', atl.Uid 'AttributeTypeLinkUid'
FROM equipment e
JOIN attribute a ON a.equipmentuid = e.uid
LEFT
JOIN attributetypelink atl ON atl.attributeuid = a.uid
LEFT
JOIN attributetype att ON att.uid = atl.attributetypeuid
-- WHERE e.name = '' -- You can add the equipment name here as a filter
ORDER
BY e.displayname ASC,
a.displayname ASC,
att.displayname ASC
With this query, we need to find the AttributeLinkUid(s) that we want to remove, in order to satisfy the 2 rules above. To delete the bad record(s), you can use the following query and change the Uid in the script, using the AttributeTypeLinkUid column from the 1st query (should be the last column on the right).
DELETE FROM attributetypelink WHERE uid = ENTER_NUMBER_HERE
Hi, yes we checked and found that "There is more than 1 Attribute with the same type (Production Event Quantity)." as you mentioned. It was not easy to fix but we are not having this issue right now. Thanks for your support.