Server Objects
Description
Create a new folder.
Syntax
RDFolderController.CreateFolder(Folder Name, Parent Folder, Index Card)
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Create an instance of RDIndexCardController to manage index card operations Dim icc As RDIndexCardController = srv.CreateController(ControllerType.RDIndexCardController) ' Retrieve a specific index card by its name Dim indexCard As RDIndexCard = icc.GetIndexCardByName("General") ' Retrieve a specific parent folder by its unique identifier (ID) Dim parentFolder As RDFolder = fc.GetFolderById(50658) ' Create a new folder under the specified parent folder using the retrieved index card Dim newFolder As RDFolder = fc.CreateFolder("new folder", parentFolder, indexCard) ' Save the changes made to the new folder newFolder.Update()
Description
Get the folder object by folder id.
Syntax
RDFolderController.GetFolderById(Folder ID)
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its unique identifier (ID) Dim f As RDFolder = fc.GetFolderById(1)
Description
Get the folder object by folder path.
Syntax
RDFolderController.GetFolderByPath(Folder Path, True = Auto create folder if does not exists)
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its path Dim f As RDFolder = fc.GetFolderByPath("Home\New Folder")
Description
Rename the folder.
Syntax
RDFolder.Name = value
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its path Dim f As RDFolder = fc.GetFolderByPath("Home\Accounting\Invoices") ' Change the name of the retrieved folder to "Vouchers" f.Name = "Vouchers" ' Save the changes made to the folder f.Update()
Description
Move the folder to new location.
Syntax
RDFolder.MoveTo(Parent Folder, ACL MoveOption: 0 = Align to Source, 1 = Align to Destination)
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its unique identifier (ID) Dim f As RDFolder = fc.GetFolderById(1) ' Retrieve the new parent folder by its unique identifier (ID) Dim newParent As RDFolder = fc.GetFolderById(2) ' Move the retrieved folder to the new parent folder, with ACL Move Option 0 or 1 f.MoveTo(newParent, 1) ' Save the changes made to the folder after moving it f.Update()
Description
Delete the folder and move to recycle bin.
Syntax
RDFolder.Delete()
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its unique identifier (ID) Dim f As RDFolder = fc.GetFolderById(1) ' Delete the retrieved folder f.Delete() ' Save the changes made to the folder after deletion f.Update()
Description
Get the document object by document id.
Syntax
RDDocumentController.GetDocumentById(Document ID)
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(100)
Description
Get the document object by document path
Syntax
RDDocumentController.GetDocumentByPath(Document Path)
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its path. The path should be relative to the document storage location. Dim path As RDDocumentController.DocumentByPathResult = dc.GetDocumentByPath("Home\New Folder\Document1.pdf") ' Access the retrieved document from the result Dim doc As RDDocument = path.Document
Description
Rename the document.
Syntax
RDDocument.Name = value
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its path. The path should be relative to the document storage location. Dim path As RDDocumentController.DocumentByPathResult = dc.GetDocumentByPath("Home\New Folder\Document1.pdf") ' Access the retrieved document from the result Dim doc As RDDocument = path.Document ' Rename the document to "Document2" doc.Name = "Document2.pdf" ' Save the changes made to the document doc.Update()
Description
Move the document to another folder.
Syntax
RDDocument.MoveTo(Parent Folder, ACL MoveOption: 0 = Align to Source, 1 = Align to Destination)
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(1) ' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its unique identifier (ID) Dim folder As RDFolder = fc.GetFolderById(1) ' Move the retrieved document to the specified folder, with ACL Move Option 0 or 1 doc.MoveTo(folder, 1) ' Save the changes made to the document after moving it doc.Update()
Description
Copy the document to another folder.
Syntax
RDDocument.CopyTo(Parent Folder)
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(1) ' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Retrieve a specific folder by its unique identifier (ID) Dim folder As RDFolder = fc.GetFolderById(1) ' Copy the retrieved document to the specified folder doc.CopyTo(folder) ' Save the changes made to the document after copying it doc.Update()
Description
Update the document index field values.
Syntax
RDDocument.DocProps(Field name or Field id) = value
Example
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(1) ' Set the "Document Number" property of the retrieved document to "DN0001" doc.DocProps("Document Number") = "DN0001" ' Save the changes made to the document after updating its properties doc.Update()
Description
Update the document table index field values.
Syntax
RDPropertyItem.DocumentProperty(Field name or Field id) = value
Example (add new row)
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(1) ' Access the property group named "Account detail" from the retrieved document's detailed properties Dim dt As RDPropertyGroup = doc.DetailProps("Account detail") ' Create a new property item within the specified property group Dim pi As RDPropertyItem = dt.CreateNew() ' Set the "Account Code" property of the new property item to "123" pi.DocumentProperty("Account Code") = "123" ' Set the "Account Name" property of the new property item to "HSBC" pi.DocumentProperty("Account Name") = "HSBC" ' Save the changes made to the new property item pi.Update() ' Update the count of properties in the property group after adding a new item dt.UpdateCount() ' Save the changes made to the document after updating its detailed properties doc.Update()
Example (update existing row)
' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(60942) ' Access the property group named "Account detail" from the retrieved document's detailed properties Dim dt As RDPropertyGroup = doc.DetailProps("Account detail") ' Iterate through each property item in the specified property group For Each dp As RDProperties In dt.GetLists(0, 0)
' Check if the "Account Code" property of the current item is equal to "123" If dp.DocumentProperty("Account Code") = "123" Then
' Update the "Account Code" property to "456" dp.DocumentProperty("Account Code") = "456" ' Save the changes made to the current property item dp.Update() End If Next ' Update the count of properties in the property group after modifications dt.UpdateCount() ' Save the changes made to the document after updating its detailed properties doc.Update()
Description
Call the AI Capture API to auto recognize the document and move document to related folder
Syntax
LocalAI().DocumentClassification(Server Object, Document Object, Parent Folder ID)
Example
' Create an instance of RDFolderController to manage folder operations Dim fc As RDFolderController = srv.CreateController(ControllerType.RDFolderController) ' Create an instance of RDDocumentController to manage document operations Dim dc As RDDocumentController = srv.CreateController(ControllerType.RDDocumentController) ' Create a new instance of LocalAI to perform document classification and key information extraction Dim ai As New WebPortal.LocalAI() ' Retrieve a specific document by its unique identifier (ID) Dim doc As RDDocument = dc.GetDocumentById(1) ' Get the ID of the parent folder of the retrieved document Dim parentFolderId As Long = doc.ParentFolder.ID ' Classify the document and retrieve the classification result Dim classificationResult As Tuple(Of Boolean, Long, String, Long) = ai.DocumentClassification(srv, doc, parentFolderId) ' Check if the classification was successful Dim classificationIsSuccess As Boolean = classificationResult.Item1 If classificationIsSuccess Then ' Get the target folder ID for classification from the result Dim classificationTargetFolderId As Long = classificationResult.Item2 ' Retrieve the folder object using the target folder ID Dim folder As RDFolder = fc.GetFolderById(classificationTargetFolderId) ' Enable automatic renaming for the document doc.AutoRename = True ' Save changes made to enable auto-renaming doc.Update() ' Move the document to the specified target folder doc.MoveTo(folder, 1) ' Extract key information from the moved document using LocalAI ai.ExtractKeyInformation(doc, srv) End If
There are no comments for now.