09-15-2021 12:35 PM
Hi,
I am writing a Unity Scheduler script in C#. I am trying to use a numeric keyword that is configured as an "Auto Numbered Key".
I cannot figure out how to access this functionality. sdk.onbase.com does not seem to have any references that I can find, nor does the intellisense when I am using the "KeywordType.CreateKeyword"... the CreateBlankKeyword doesn't return a value (blank, as expected). The CreateKeywordWithDefaultValue doesn't seem appropriate as it requires a DocType paramamter.
Is there any way to access the functionality provided by an auto number keyword through the Unity API?
I am using the C# code to (ultimately) create a Unity form. I am trying to define a "Batch" of unity forms that are created by the Unity script. So I do not want to put the batch number keyword on the Unity Form or it will (possibly) auto-increment for each form created, which is not what I want.
I want to fetch Auto-Number "Batch Number" keyword once, create a string (Batch Name) with the batch number (eg: "BATCH 1") and put the Batch Name keyword on each unity form.
I'm trying to avoid creating a new document type with a single document to store the continually incrementing Batch Number.
Thanks,
Steve Williams
09-20-2021 09:33 AM
Followup from API Support via our FLOS
It actually is possible to assign an auto number keyword through the API, though the process isn't exactly intuitive. CreateKeywordWithDefaultValue is the correct method to use, but it needs to be used in conjunction with the StoreNewUnityFormProperties object's ExpandKeysets property set to true. With both of these items, Unity Forms and E-Forms can have their auto number keywords populated with an incrementing value.
It doesn't seem that this alone would satisfy the requirement described though. I think they would still need to create a dummy document type with this keyword, then retrieve that value from the newly created document to be applied to all unity forms in the batch, and finally delete the dummy document.
09-16-2021 08:10 AM
Hi
I don't believe there is any Auto Number Keyword functionality within the Unity API as you noticed since there is no documentation from the SDK. However, if you were to create the Unity Form with a Keyword Type configured as an Auto Number Keyword Type, the Keyword Type configured as an Auto Number Keyword Type should increment accordingly. Unfortunately this will not address your issue since as you noted this value would then increase with the submission of each new form.
The idea of using a separate Document Type to store a Document used as the primer for the Auto Number Keyword value would work. While it is not ideal, it would provide the functionality you are looking for. The caveat here is would be what is triggering the Auto Number Keyword value to increment? You would have to have a new Document storing storing the incremental value so you could capture it.
One way to do this would be through the use of a Virtual E-Form. You could create the Virtual E-Form, capture the Auto Number Keyword value into a Property Bag property and then delete the Virtual E-Form. This way you always have the current Auto Number Keyword value.
Best wishes.
09-17-2021 07:44 AM
Hello Steve
As a way to perform auto numbering, you want to create a new document type like "XXX - Internal Sequences" with 2 keywords description and any other using numeric data type.
In your code just retrieve a that document base on "Description" keyword (So you can have multiple sequences) grab current number, increment and saved retrieved document.
Hope this idea works in your case
Regards
09-20-2021 09:33 AM
Followup from API Support via our FLOS
It actually is possible to assign an auto number keyword through the API, though the process isn't exactly intuitive. CreateKeywordWithDefaultValue is the correct method to use, but it needs to be used in conjunction with the StoreNewUnityFormProperties object's ExpandKeysets property set to true. With both of these items, Unity Forms and E-Forms can have their auto number keywords populated with an incrementing value.
It doesn't seem that this alone would satisfy the requirement described though. I think they would still need to create a dummy document type with this keyword, then retrieve that value from the newly created document to be applied to all unity forms in the batch, and finally delete the dummy document.
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.