Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
LAPI-VB Storing dates in category attributes.
Jeff_Shuey_(kofax_jshuey_(Delete)_1212801)
In short, I am assigning a user selected category to a document, then trying to fill the attribute values. Categories with attributes of type string and number work great. Categories with attributes that are of date type are not being assigned a value. I understand LAPI wants the date as a long, I am unsure how to convert the date to a long. The code I inherited calculates the number of seconds since 01-01-1970, then assigns the value to a table, which in turn assigns the values to the documents category attributes.Here is the code snippet:-- begin ---Case LL_ATTR_DATATYPE_DATEDim lTempDate As LonglTempDate = GetDateValue(pAttributeArray(2, j)) If lTempDate = -1 Then 'Call error logging routine End IflReturn = LL_TableSetDate(lAttributesValue, i - 1, "Value", lTempDate)'*** assign the values to the attributeslReturn = LL_SetObjectAttributes(glSessionID, lDocVolID, lDocNodeID, lAttributesValue)-------Public Function GetDateValue(dString As String) As Long GetDateValue = DateDiff("s", "12/31/1969", dString) End Function-- end snippet --Similar code is used to store strings and integers which store correctly with the document.lReturn = LL_TableSetString(lAttributesValue, i - 1, "Value", CStr(pAttributeArray(2, j))) I am uncertain if the date is being calculated correctly, or if the lAttributesValue (of type ll_table) has been initiated correctly for date handling.Any help would be greatly appreciated.
Find more posts tagged with
Comments
Steve_Garetto-Barnett_(x-disnco01admin_-_(deleted)
Your method of calculating the date agrees with what I came up with, and the dates that are being set appear to be correct on our system, so I'd say go with it.Jeff Wilsonjeffreyjwilson@earthlink.net