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
Successfully in creating document but failed to inherit Category. URGENT~!
ImvecUser1_(Delete)_2148388
We are using LAPI9.0 on VB. I encountered failure on creating document with Category inheritance from its parent folder. The method I have been using is LL_CreateObjectEx and LL_CreateVersion. Actually I successfully created the document however there was no categories inherited from the parent folder, Moreover the "ObjectInfo" assoc turned out nothing which I couldnt get the objectID. Without objectID, the LL_CreateVersion function also failed. Here is my code: For creating object: Dim createInfo As LongDim categories As LongDim objectInfo As LongDim versionInfo As LongLL_ValueAlloc createInfoLL_ValueAlloc categoriesLL_ValueAlloc objectInfoLL_ValueAlloc versionInfo'To make an empty assoc value object for createInfo for LL_CreateObjectEx function status = LL_ValueSetAssocInArgs(createInfo)'createInfo.categories is a value object of type list status = LL_ValueSetList(categories)status = LL_ValueSetLength(categories, 1)'catVersion Assoc has been retrieved previously using LL_GetObjectAttributesEx status = LL_ListSetValue(categories, 0, catVersion)status = LL_ValueSetUndefined(objectInfo)status = LL_ValueSetFieldValue(createInfo, "Categories", categories)status = LL_CreateObjectEx(session, ParentVol, ParentID, 0, 144, "A new document", createInfo, objectInfo)'The turned out status is "101107" which should be abnormal, i guess MsgBox status'The above function can create a document with no version in the specified folder. However it failed to inherit any categories from the parent folder. 'The turned out NewObjID was 0 which I think there was error happened status = LL_AssocGetInteger(objectInfo, "ID", NewObjID) 'The LL_CreateVersion failed to work without a zero NewObjID status = LL_CreateVersion(session, ParentVol, NewObjID, "c:\temp\vb.txt", versionInfo)Since it is very urgent please advise. Thanks in advance.
Find more posts tagged with
Comments
Richard_Boyne_(boyne_(Delete)_891609)
You can use code similar to the following to determine why status 101107 was returned on the CreateObjectEx call.This code comes from the the "Error Checking" sub-section of the "Overview" section of the "Livelink SDK API Developer's Reference"---------------------------------------------------In the Visual Basic environment, the return value can be used to implement error checking as follows:If ( LL_AccessEnterpriseWS(session, value) <> LL_OK ) Then retVal = LL_SessionStatusError ( session, status, message, errMsg, apiError ) If retVal = LL_OK Then status = LL_ValueGetString ( errMsg, buf1, 255, siz ) status = LL_ValueGetString ( apiError, buf2, 255, siz ) msgBox "Message = " & buf1 & buf2 Else msgBox "Could not retrieve error message" End IfElse ...block of code...End If------------------------------------------------------One possibility for the error returned from CreateObjectEx would be that the category to be inherited has an attribute for which a value is Required and no defult value was specified at the Category's definition. You can set attribute values of Categories using CreateObjectEx. Look at the createInfo.Categories description in the doc for this function.A problem that your description highlights is that CreateObjectEx creates the object and returns an error. I suspect that the object should not exist if CreateObjectEx returns an error. Bug entry 1686580 reports this problem.