12-01-2017 04:25 PM
I'm using the API to write a series of documents to OnBase using the Unity API. In some cases I have to go back an add keywords to the newly created documents because they were unknown at the beginning of the process. The keywords are getting added correctly, however the AutoName string on the Document does NOT get updated?
Here's the code I'm using to make the change:
using (DocumentLock docLock = PackageDoc.LockDocument())
{
if (docLock.Status == DocumentLockStatus.LockObtained)
{
KeywordModifier MemberNoKWModifier = PackageDoc.CreateKeywordModifier();
MemberNoKWModifier.AddKeyword(MemberNoKW);
MemberNoKWModifier.ApplyChanges();
}
}
Is there something I need to do after the ApplyChanges() or an option I need to set before ApplyChanges() that would affect an update to the AutoName string?
Thanks!
Brett Booz
Systems Analyst
Spokane Teachers Credit Union (STCU)
12-04-2017 09:42 AM
Hi! Brett,
The Untiy API would trigger the autoname when keywords gets updated.
In the code, if we change the code like this:
MemberNoKWModifier.UpdateKeyword(oldKW, MemberNoKW);
Both the keyword and document name should be updated.
It seems that KeywordModifier.AddKeyword would add a new keyword of the same type to the document if the document has the keyword in this type already. It will not trigger the autoname since there is no keyword updated but added.
If you have any questions. Please let me know!
-Jason
12-04-2017 10:37 AM
12-04-2017 03:12 PM
12-05-2017 05:56 AM
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.