Omnitracker – autoarchivization

Omnitracker lacks of one of the most important function – why till now it was not implemented, God one knows! I suppose all customers are asking themselves this urgent question.

Without this functionality you have to once a year/month review all the folders and create subfolders with proper date and exclude them from main OT Index. Otherwise your OT index grows so fast that Omnitracker perfomance is in danger!

In order to achieve this super important function in Omnitracker there’s a simple solution – you need to use below script:

 Autoarchivization script
'Constants and variables

Dim fld, FldArchive, FldNewYear

Dim y, strFolderName, strFolderArchive

Dim Filter, Requests, req


strFolderArchive = "FolderName\ClosedRequests"

Set FldArchive = ActiveSession.GetRequestFolderByPath(strFolderArchive)

Set Filter = FldArchive.MakeFilter

Set Requests = FldArchive.Search(Filter, False)

For Each req In Requests

If Not req.UserFields("CreationDate").IsNull Then

y = Year(req.UserFields("CreationDate").Value)

On Error Resume Next

Err.Clear

strFolderName = strFolderArchive & "\" & y

Set fld = ActiveSession.GetRequestFolderByPath(CStr(strFolderName))

If Err.number = 0 Then

'folder exist - move req to proper folder

req.Move(fld)

Else

Set FldNewYear = ActiveSession.RequestFolders.Add(y, y, FldArchive)

If Err.No <> 0 Then

LogMessage "Error creating folder:" & Err.No & Err.Description

Else

'move request to new folder

req.Move(FldNewYear)

End If
End If
End If
Next


And attach it as Scheduled Job to Task Scheduler as shown below.

Now you can sleep calm – all your folders and requests will be archivized in proper manner and will be excluded from OT index. However there will be still possibility to search requests via Filters.

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *