Closed work order

A staff member closed a workorder leaving the work order status as “New.” Is the only way to fix this is to restore to last week’s data? If so, are the only directions for doing this on p 562-564 of the AyaNova v3 manual?

jlr (5/1/2006)A staff member closed a workorder leaving the work order status as “New.” Is the only way to fix this is to restore to last week’s data? If so, are the only directions for doing this on p 562-564 of the AyaNova v3 manual?


Once a workorder is closed, it is available for historical viewing only and can not be edited to prevent editing of historical information.

At this time, if a workorder has been closed when it was not supposed to, and the workorder status can not be left in its selected state, than yes, you would have to restore from before that workorder was closed.

[FORUM NOTE: AyaNova 5 now has the ability for the AyaNova Administrator to open a workorder that was previously Closed - refer to the AyaNova 5 Help file for details]

  • Joyce

Joyce, I was getting ready to ask the following question and fouind this thread and thought it appropriate.

I have mine setup for SQL db. Using SQL Server Enterprise Manager, I browsed the WORKORDER table and saw two fields called ACLOSED and ASERVICECOMPLETED. I don’t want to test on my live data so I will ask instead. If my coordinator accidently closes and/or completes the workorder via the checkboxesI should be able to access the table and change those values back to 0. Do you see any problem with this as I don’t know if any other field across the tables in the db are affected when an order is closed for good?

Until the software allows admin access to change the status back through the front end, this seems like the only viable course of action in case this happens or if someone forgets to enter all info, etc. before closing up for good.


Hi Dan, Joyce asked me to answer this one. The short answer is no.

The long answer:

While it’s not safe to ever modify anything in the database manually, bypassing thethe business object library, the workorder closed just happens to be about at the top of the list of most dangerous things to manually change. :slight_smile:

AyaNova not only does a lot of processing on many other objects in the database when the status of those fields changes, it absolutely relies on the fact that a closed workorder will never become an open work order again.

When a work order is set to closed and saved it checks dozens of other properties on related objects and within the work order itself to ensure it’s valid and safe to be closed.

If those checks pass it then sets off a chain of events that are irrevocable: It modifies every child and grandchild object in a workorder (i.e. workorder items, every item under workorder items). It updates the Client and Unit objects with the correct links to the last workorder that they were serviced on. It processes all manner of notification events related to workorder close by dates, outside service items, etc etc.

So the problem boils down to this: you unclose and un-service completed a workorder through the database. Now you have a work order you can open and edit, but all the other objects that rely on it were processed already as it was originally closed and service completed. You enter in new data into it and that data is related to objects that have already had their closed and service completed processing done. Everything becomes a mess at this point and the worst kind of mess, the not immediately obvious kind of mess.

Once a work order is closed it’s closed permanently. Any attempt to circumvent this will break all sorts ofthings that you might not realize are related to that work order.

The only safe way to modify data in the AyaNova database is through the business objects themselves either with a program of your ownor with the AyaNova user interface orutilities. This will not solve your problem though which is that the business objects deliberatly do not allow a work order to be re-opened for the reasons above.

While it might be tempting and in the short term it will appear to work you will run into all sorts of trouble down the road with other features completely broken by this.

It’s important that your staff understand the significance of closing a work order (heeding the warning message that displays and says that it’s irrevocable and permanent) and if they are not able to do that then you might want to consider removing certain rights to ensure that only a manager can close a work order.

I know it’s very tempting to make changes in the data if you come from a database background and can clearly see it there, in fact we seriously considered the idea of encrypting or checksumming every record in the database just to detect manual changes but decided it would hurt performance too much so we’re relying on people to heed our warnings on this.

It’s not because we’re control freaks, it’s because all the safety of the data is handled in the business object library. The database has no logic in it for ensuring the safety of the data, it’s just too complex to be handled at that level. All the objects are interrelated to a high degree.

Sorry to go on so much about this :)but I get very worried when I see this stuff because I know how badly it will break AyaNova and I can’t imagine how we would ever sort it out again short of restoring from a backup. The problem is that you might not notice the problem until a critical time months later and a lot of data could be lost.

Hi Dan

As per John’s reply above, we have looked further intothe ability to have the AyaNova Adminstratorre-open a closed workorder, but it is not feasibledue to all the aspects of the database that are affected.

What we do have on our future feature list is to include:

  1. Include a right specifically tothe Closed field in a service workorder via the security group a user belongs to. This way depending on the security group a user belongs to, either the Closed checkmark field will be grayed out but viewable, or it would be editable. (EDIT: this feature is now provided in AyaNova 3)

  2. Include Global Settings default to change the Workorder Status to a set status when the workorder is checkmarked Closed. This way, when a workorder is set to closed, it will automatically set the Workorder Status as stated in the Global Settings. (EDIT: this feature will be in future release AyaNova 4)

  • Joyce

Actually, item #1 sounds great. As the manager, admin of the program/db, along with the final authority to close a workorder, to be able to block all users from closing them with the exception of myself would be great!!


When we imported the data from the previous version of AyaNova, all the work orders that already existed, were automatically marked closed. Is there any way to change that status so that we can enter the invoice numbers?


You would need to edit the workordersin AyaNova CE to <In Progress> prior to importing into AyaNova v3.

All workorders in AyaNova CE that are presently select to <Closed> are checkmarked Closed in AyaNova v3 when imported. Workorders set to <Closed> in AyaNova v3 are for historical viewing - they can no longer be edited.

As outlined in the manual section “Important information to review prior to importing”, if you do not want the workorders set to <Closed> in AyaNova CE to be imported and checkmarked Closed in AyaNova v3 - the workorders in AyaNova CE would need to be reset to <In Progress> prior to being imported into AyaNova v3.

As the AyaNova v3 database is erased automatically prior to importing via the CE Import utility, you can edit the workorders in AyaNova CE to <In Progress>, and than perform the import again without importing duplicate data.

The data in an AyaNova v3 database that is not erased is the Global Settings, the default AyaNova Administrator user with username manager with password letmein, Tax Codes, Regions, Default warehouse, Localized Text, and any sample reports, in the AyaNova v3 database

  • Joyce

What would be the remifications of leaving each workorder open (or unlocked) so that you select only the Closed item available as the menu item to mark the item closed but it would be (locked) closed.

Otherwise can it be set that when you mark closed, it only marks it for review by the admin, or set other fields to closed so that its not left open acidentally.

Or only let Administrators mark it as closed.

Peter Fuzessery

Miad systems Ltd.

Only issues with leaving a workorder “un” closed
you would not be able to utilize the Closed column in the grids for filtering
A user could edit this workorder at any time - changing the historical information
I’m also providing in this posting steps on how to manually edit the precise information in the AyaNova database table if you must have a workorder status set to something different after it has been set to Closed.

Again, I am stressing, do not directly edit the AyaNova database table without confirmation from us. Doing so will most likely cause broken data links and corrupt your database.

The following is information for changing a workorder status only - as doing so won’t break a data link on closed workorders.

Read through the instructions first

Make a backup of your AyaNova database
Have all users out, and any additional AyaNova related programs closed if applicable
On this server, open a NotePad document so you can copy and paste stuff into here, minimize
If using a network SQL AyaNova configuration, you need to open the database using a SQL Server management utility such as SQL Server Management Studio Express and connect to the SQL Express server
If using network Firebird configuration, you need to open the database using a Firebird database management utilitiy such as EMS SQL Manager 2005 for Firebird
Expand Databases so that you see the AyaNova database
Expand the AyaNova database so that you see Database Diagrams, Tables etc
Expand Tables
(we are going to identify the ID for the workorder statuses we are dealing with)
Scroll to the bottom, and right-click on AWORKORDERSTATUS and select Open Table
Give it a sec and it will open up a table of all the workorder statuses in a grid to the right
Scroll as needed to the right so that you can see the ANAME column
Click on the row indicator on the left of the grid to highlight the row that is for the workorder status “In Progress” (or whatever your is that these workorders are at right now)
From the AID column for this row, highlight the ID and copy and paste into the NotePad document
Now click on the row indicator on the left of the grid to highlight the row for workorder status “Completed” (or whatever it is that you want these workorders to be)
Again, copy and paste the ID into NotePad on another line
(now we are going to find the workorders that are closed and replace the ID for the In Progress status to Completed status)
Right-click on the AWORKORDERSERVICE table and select Open Table
Scroll so that you can view the ASERVICENUMBER column
Scroll down and find the first workorder number you had in your list that you need the workorder status changed from
When you find it, click on the row indicator so that the complete row is highlighted (easier to identify exactly which row this way)
Find the AWORKORDERSTATUS column - this should have the ID in it of the “In Progress” workorder status, what you will do is copy the ID from your NOtePad document for the Completed status and replace this.
As soon as you tab off after pasting, it is saved.
Once you have done all the workorders, close out
Log into AyaNova and check the status for those workorders.
Again, I have to stress, only do this after you have made a backup of your database in case something is adversely affected, and if you have a question, do contact us before continuing.

If you are not comfortable doing this, we may be able to do this for you.

Contact directly via
Provided the precise workorder numbers that are to be changed
the exact name of the Workorder Status they are at now
the exact name of the Workorder Status you want them changed to
the total number of workorders you have in your entire database (display All Workorders instead of the first 100 to get this number),
copy of your ayalog.txt file,
what server is in use (network Firebird Server, SQL Server 2000, SQL Server 2005 or SQL Server Express 2005)
and suggested date/time you can ensure all users out and send a backup of your database to us for us to.
We can than provide a quote on what it would cost to have this edited directly for you, confirm that the date/time provided is mutually convienent, and at/slightly before that date/time you send a compressed copy of your database, along with info above again.

  • Joyce

Update to this thread:

AyaNova v3.2.5 now includes the ability to set the security right to the Closed checkbox in the workorder entry screen.

All existing security groups will now have a new security group objectObject.Workorder.Close

If you do not want this security group to have access to the Closed checkbix, set the right to Read Only or Forbidden

If you do want the security group to be able to close workorders, set the right to Read/Write/Delete or Read/Write.

Hi Joyce,

Do you foresee any problems occurring if we change the ‘Object.Workorder.Close’ to Forbidden for Administrator account in order to preventQBI from closingworkorders after invoicing them? Or will changing this even have an effect on the QBI module?



Hi Bob

No - changing the security right for Object.WorkorderClose will not affect that QBI closes a workorder after invoicing if set to do so in QBI Preferences.

QBI will always close a workorder after invoicing if set to do so in the QBI Preferences. Once a workorder has been invoiced, it can not be edited otherwise that would affect historical information on this workorder that has been invoiced.

Do note that you can not edit the rights to the security group AyaNova Administrator, nor the security group that the AyaNova Administrator is a part of. By default the AyaNova Administrator security group has full Read/Write/Delete rights to everything, and by default the AyaNova Administrator is always only a member of this security group. It would be instead suggested that you create a security group that has Read/Write/Delete to everything except for the Object.WorkorderClose, and assign your managers to that.

  • Joyce

Update to the previous question about QBI not closing workorders.

This is now a feature of QBI - in that you now have the option in Preferences of setting whether QBI closes the workorder or not once the invoice has been made. Check out the latest QBI version.

  • Joyce