12-17-2014 07:14 AM
I am having trouble bringing in a property that contains multiple instances of a keyword. The "Set property to all keyword value instances" checkbox is checked. They keyword is defined as "Numeric (Up to 20 Digits)".
In my code I have this:
System.Int32[] expID2;
bool sourceFound = propertyBag.TryGetValue("propExposureID", out expID2);
I get this:
Task list execution failed: Unexpected error: Type is not the requested Type: System.Int32
I also tried using Int[], short[], and long[], but it still fails.
What am I doing wrong?
12-17-2014 09:25 AM
Good afternoon,
20-digit numeric values use the decimal type (since they won't fit into even a 64-bit integer), so please try using a decimal[].
12-17-2014 09:43 AM
[quote user="Rob Herman"]
Good afternoon,
20-digit numeric values use the decimal type (since they won't fit into even a 64-bit integer), so please try using a decimal[].
Hi Rob,
Is there table that maps Keyword Value Types to the preferred data type? We are planning to update a Hyland.Services based library to Unity and some data validation would be useful before allowing other systems to upload documents with keywords. This information would be extremely helpful for this upgrade project.
Thanks!
12-17-2014 09:27 AM
This may not make complete sense, but I would try to retrieve as a string array. Even though the keyword type is Numeric, there isn't really a way to set the Property type and usually string works and I will convert/parse to other types as needed.
If you are running against a single document, you could also just retrieve the keyword values directly from the document instead of using a property bag.
12-17-2014 09:56 AM
Good afternoon Tharon,
In the SDK, in Home / Programmer Guide / Documents and Keywords / Working with Keywords / Accessing Keywords in Keyword Records topic, there is a code sample that demonstrates the appropriate .NET data type for each Keyword Type data type.
In brief: Alphanumeric keywords use string; Currency, Specific Currency, and Numeric 20 keywords use decimal; Date and Date/Time keywords use DateTime; Floating Point keywords use double; and Numeric 9 keywords use long.
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.