cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

RTPPM Adjust Production Quantity Error

oaslan
13-Aquamarine

RTPPM Adjust Production Quantity Error

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."

ACCEPTED SOLUTION

Accepted Solutions
mstarnaud
15-Moonstone
(To:oaslan)

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

 

View solution in original post

3 REPLIES 3
mstarnaud
15-Moonstone
(To:oaslan)

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

 

mstarnaud
15-Moonstone
(To:mstarnaud)

Hi @oaslan 

Do you have an update on this?

oaslan
13-Aquamarine
(To:mstarnaud)

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.

Announcements


Top Tags