Its not that simple to uncheck the archive flag by ur custom program.
In sap all the status updates is done in many tables even if u uncheck only
one table it will not allow you to edit the document.
I have no experience in CRM but i recommend you to check with ur function guys
they will help you.