How to Remove Docentric AX Framework
The goal of this tutorial is to guide you through the removing of Docentric AX Framework.
1. Remove Docentric Document Types and related entities
We need to execute the following job that is going to:
- remove entries from Docentric reporting archiving Document Types and related entries in Print Archive and Report Attachments (PrintJobHeader, DocuRef and DocuValue tables)
- remove entries from Docentric Document Types for Document Template Libraries and related entries in Document Attachments (DocuRef and DocuValue tables)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
static void removeDocentricDocumentTypes(Args _args) { // Docentric Report DocuType for Archiving. #define.DocReportArchiveDocuTypeId('DOCReport') // Docentric Report DocuType for Attachments. #define.DocReportAttachDocuTypeId('DOCFile') // DocuAction class names for Docentric Document Libraries. #define.DocTemplatesFSActionClassName('DocDocuActionFileSystem') #define.DocTemplatesSPActionClassName('DocDocuActionLibrary') ClassId docTemplatesFSActionClassId = className2Id(#DocTemplatesFSActionClassName); ClassId docTemplatesSPActionClassId = className2Id(#DocTemplatesSPActionClassName); DocuType docentricDocuType; DocuRef docentricDocuRef; PrintJobHeader docentricPrintJobHeader; DocuValue docentricDocuValue; try { // 1) Clean up Reports, Print Archives and Attachments info('Cleaning up Docentric SSRS and Basic Report Document Types - Print Archive and Attachments...'); ttsBegin; // Delete from Print Archive. delete_from docentricPrintJobHeader where docentricPrintJobHeader.jobType == #DocReportArchiveDocuTypeId; // Delete from DocuRef -> Cascading Deletion from DocuValue. while select forUpdate docentricDocuRef where docentricDocuRef.TypeId == #DocReportArchiveDocuTypeId || docentricDocuRef.TypeId == #DocReportAttachDocuTypeId { docentricDocuRef.delete(); } // Delete from DocuType. while select forUpdate docentricDocuType where docentricDocuType.TypeId == #DocReportArchiveDocuTypeId || docentricDocuType.TypeId == #DocReportAttachDocuTypeId { docentricDocuType.doDelete(); } ttsCommit; info('Docentric SSRS and Basic Report Print Archive and Attachments have been successfully cleaned up.'); // 2) Clean up Docentric Document Libraries. info('Cleaning up Docentric Document Libraries...'); ttsBegin; if (docTemplatesFSActionClassId || docTemplatesSPActionClassId) { while select forUpdate docentricDocuType where docentricDocuType.ActionClassId == docTemplatesFSActionClassId || docentricDocuType.ActionClassId == docTemplatesSPActionClassId { // Delete from DocuRef -> Cascading Deletion from DocuValue. while select forUpdate docentricDocuRef where docentricDocuRef.TypeId == docentricDocuType.TypeId { docentricDocuRef.delete(); } // Delete from DocuType. docentricDocuType.doDelete(); } } else { while select forUpdate docentricDocuType { if (classId2Name(docentricDocuType.ActionClassId)) { continue; } // Delete from DocuRef -> Cascading Deletion from DocuValue. while select forUpdate docentricDocuRef where docentricDocuRef.TypeId == docentricDocuType.TypeId { docentricDocuRef.delete(); } // Delete from DocuType. docentricDocuType.doDelete(); } } ttsCommit; info('Docentric Document Libraries have been successfully cleaned up.'); } catch { error('Cleaning up Docentric Document Types failed.'); } } |
You can download the job XPO file here:
Job_removeDocentricDocumentTypes.xpo
During the job execution you will be prompt to confirm the removal of documents related to those Docentric Document Types whose Document removal options have contained the Ask for confirmation flag set to Yes.
After the job has been executed Infolog with the following messages shows up.
2. Uninstall the DocentricAX model / delete the USP layer
Close the AX client application and delete the DocentricAX model or the USP layer using a command-line utility – AXUtil.
Open Microsoft Dynamics AX 2012 Management Shell in Control Panel\All Control Panel Items\Administrative Tools.
For deleting the model use the following command:
1 |
axutil delete /model:DocentricAX |
For deleting the layer use the following command:
1 |
axutil delete /layer:usp /verbose |
3. Manual deletion of the Docentric AX Framework projects
You can delete a project and its content (all artifacts from the project) using the following job:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
static void delProjectAndItsContent(Args _args) { ProjectNode privatePn, sharedPn; ProjectNode pn, pn2; TreeNodeIterator projectNodeIterator; TreeNode projectArtifact; str projectName = 'Test'; void deleteChildNodes(TreeNode _parentNode) { TreeNodeIterator nodeIterator; TreeNode childNode; nodeIterator = _parentNode.AOTiterator(); childNode = nodeIterator.next(); while (childNode != null) { deleteChildNodes(childNode); childNode.AOTdelete(); childNode = nodeIterator.next(); } } new ExecutePermission().assert(); // Navigate to the Private projects folder. privatePn = infolog.projectRootNode().AOTfindChild("Private"); // Get a reference to the project. pn = privatePn.AOTfindChild(projectName); if (pn == null) { // Navigate to the Private projects folder. sharedPn = infolog.projectRootNode().AOTfindChild("Shared"); // Get a reference to the project. pn = sharedPn.AOTfindChild(projectName); } if (pn) { pn2 = pn.loadForInspection(); projectNodeIterator = pn2.AOTiterator(); projectArtifact = projectNodeIterator.next(); while (projectArtifact != null) { deleteChildNodes(projectArtifact); projectArtifact = projectNodeIterator.next(); } // Delete the project itself. pn.AOTdelete(); info(strFmt("Project %1 is deleted", projectName)); } else { info(strFmt("Project %1 does not exist", projectName)); } CodeAccessPermission::revertAssert(); } |
You can download the job XPO file here:
Job_delProjectAndItsContent.xpo
Beside Docentric AX artifacts, you have to delete the DOC label file from AOT. Read how >>
4. Clean your environment
Reset usage data, synchronize Data Dictionary, perform Full Compile, generate Incremental/Full CIL and restart the AOS.
See also
How to Install Docentric AX Framework via Model >>
How to Install Docentric AX Framework via XPO files >>
How to Install Docentric AX Template Designer >>