[FORUM NOTE: This issue has been resolved in AyaNova 4.2]
When I am on the Preventive Maintenance page and highlight a PM and click “Manually generate service workorder” a new workorder opens. The error occurs when I goto save the new workorder, I get the following error and AyaNova closes without saving the new workorder.
violation of PRIMARY or UNIQUE KEY constraint “PK__AWORKORDER__587208C1” on table “AWORKORDER”
Have not seen this error message before. Please provide the following so that I can recreate:
What version of AyaNova is in use?
By what configuration are you connecting - single user default, Firebird Server, SQL Express or SQL Server?
Does this occur only for this PM or for any PM of yours?
Are you connecting via Data Portal, or WBI?
Provide details on what is in this PM order itself - data from each field that you have filled in so that I can recreate
Provide details on any additional data you enter into the workorder before you go to save it so that I recreate your exact steps
I am able to recreate that via a dataportal connection if you attempt to save a workorder that was manually generated froma PM, the error Violation of PRIMARY KEY constraint ‘PK__AWORKORDER__114A936A’. Cannot insert duplicate key in object ‘dbo.aWorkorder’ will occur whether using Firebird, SQL Express, or SQL.
At this time, do the following (NOTE: this is ONLY for a user using a dataportal connection wanting to manually generate a workorder):
Have your user that is connecting via data portal connection manually generate the workorder from the PM
But instead of clicking Save, the user is to click on the X in the upper right hand corner
The user will be asked “Do you want to save changes?”
User is to select “No”
Now move to the Service Workorders grid, Refresh the grid,and open the last created workorder’s entry screen as this will be the workorder created from the PM.
What occurs when you manually generate a workorder from a PM, is that internally the workorder is actually created with a placemarker just not normally shown as an actual workorder in case you cancel out. Whereas what is occurring with a dataportal connection, is that the workorder is actually saved already with a workorder number as soon as you manually generate, so when you go to save it, it conflicts with itself because its like it is telling it to save another workorder with the same number.
Thank you for bringing this to our attention. This will be fixed in the next maintenance update.
I was able to create and find the new workorder. It does not save any changed you make so if you need to do this create it, close it, and then reopen it on the service workorder page, and THEN make your changes! This should get us by until the next update. Thanks for your quick help.