02-16-2012 04:02 AM
Is there a way to update the document date for an already existing document using the Unity API? I looked through the SDK and could not find a way and when I tried using the .DocumentDate property of the document but this appers to be read-only. I have a vbScript that can do this but would rather use a Unity script.
Thanks
Anthony
02-16-2012 05:28 AM
This functionality will be available in the 12.0 release of the Unity API.
09-09-2014 03:14 PM
What is the Unity API call in 12.0 to do this?
09-10-2014 05:13 AM
As you already noted, the DocumentDate property on the document object is read-only. To change that property or any other document property (like most document update functions) requires a "modifier". I did not find any example in the current SDK, so I will request that be added in an upcoming edition of the SDK.
Here is a simple Unity API example that sets the document date to today's date:
Document doc = args.Document;
DocumentPropertiesModifier docMod = doc.CreateDocumentPropertiesModifier();
docMod.DocumentDate = DateTime.Now.Date;
docMod.ApplyChanges();
09-10-2014 03:28 PM
We tried:
var document = unityCore.GetDocumentByID(xxxx);
using (var lockDoc = document.LockDocument())
{
if (lockDoc.Status.Equals(DocumentLockStatus.LockObtained))
{
Console.WriteLine(@"Document Locked.");
using (lockDoc)
{
var t = document.CreateDocumentPropertiesModifier();
t.DocumentDate = DateTime.Now;
t.ApplyChanges();
}
}
}
however it results in an exception when the changes are applied.
Document Locked.
Hyland.Unity.UnityAPIException: An error occurred within the Unity API: Failed t
o verify id file for platter (2) 179:8:1 at: '\\SanitizedServerName\Nautilus_T_DG\DG
33\DIP_Processes\NAUTILUS.ID'
at Hyland.Unity.Application.Validate(Response response)
at Hyland.Unity.Application.ExecuteWithValidation(Request request)
at Hyland.Unity.DocumentPropertiesModifier.ApplyChanges()
at Nautilus.Program.Main(String[] a_args) in d:\Solution Files\Nautilus\Nauti
lus\Program.cs:line 37
---------------------
Server Source: Hyland.Core
Server TargetSite: System.String MountPlatter(Hyland.Core.PlatterManagement.PmCo
ntext, Hyland.Core.PlatterManagement.PhysicalPlatter, Hyland.Core.PlatterManagem
ent.FileAccessImpl, Hyland.Core.PlatterManagement.DiskgroupAliasList)
Server Exception: Failed to verify id file for platter (2) 179:8:1 at: '\\SanitizedServerName\Nautilus_T_DG\DG33\DIP_Processes\NAUTILUS.ID' ---> at Hyland.Core.P
latterManagement.Utility.MountPlatter(PmContext pmContext, PhysicalPlatter platt
er, FileAccessImpl fileAccess, DiskgroupAliasList aliases)
at Hyland.Core.PlatterManagement.Commit.CommitPage(DocumentPage page, Boolean
bForceOverwrite)
at Hyland.Core.PlatterManagement.Commit.CommitDocument(Document document, Boo
lean bForceOverwrite)
at Hyland.Core.PlatterManagement.Archival.CommitDocument(Document document, B
oolean bForceOverwrite)
at Hyland.Core.PlatterManagement.Archival.CommitDocument(Document document)
at Hyland.Core.DocumentArchiver.StoreDocument(Document document, DocumentStor
ageProperties properties)
at Hyland.Core.Unity.Services.DocumentService.applyPropertyChanges()
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.