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
AddDocument() fails if parent Folder has Category with 'required' Attributes
Chris_Hall_(linkhanduser1_-_(deleted))
Hi there,The VB code below fails to add a document to a node that is a Folder AND that Folder has a Category AND that Category has required attributes.This is LAPI 8.15 with SP1 and Patch Sept'2000. It used to work with LAPI 7.Opentext have solved similar problem in Livelink Desktop. Could you please tell me what you have done to eliminate the problem there?Cheers.Mo======================================Private Function CreateDocument(nParentVol As Long,_nParentID As Long, sTitle As String,_sFilename As String, dVolID As Long,_dID As Long) As BooleanDim status As LongDim objectInfo As LongDim VersionInfo As LongCreateDocument = FalseLL_ValueAlloc objectInfoLL_ValueAlloc VersionInfostatus = LL_AddDocument(ll_server.session, nParentVol,_ nParentID, sTitle, sFilename,_objectInfo, VersionInfo)'If nParentID is a folder with category containing'required fields, status returned is -2147418076 If status = LL_OK Then...End IfLL_ValueFree objectInfoLL_ValueFree VersionInfoEnd Function
Find more posts tagged with
Comments
Chris_Hall_(linkhanduser1_-_(deleted))
Additional info:1) If one sets a default value for the 'required' attribute, AddDocument() fails anyway.2) If one modifies the Folder's Category and makes the 'required' attribute 'included', AddDocument() works fine.Mo
eLink User
Message from Jeremy O'Connor via eLinkI suggest using CreateObjectEx to create a document object and then useCreateVersion to add the document to that object instead of AddDocument. Ibelieve there is a bug with AddDocument if the folder has requiredattributes. When using CreateObjectEx you can specify the requiredattributes in the requiredAttributes Assoc.-----Original Message-----From: eLink Discussion: LAPI Discussion[mailto:lapi@elinkkc.opentext.com]Sent: Wednesday, October 25, 2000 9:35 AMTo: eLink RecipientSubject: Additional Info. AddDocument() fails...Additional Info. AddDocument() fails...Posted by LinkhandUser1 on 10/25/2000 09:33 AMAdditional info:1) If one sets a default value for the 'required' attribute, AddDocument()fails anyway.2) If one modifies the Folder's Category and makes the 'required' attribute'included', AddDocument() works fine.Mo[To reply to this thread, use your normal e-mail reply function.]============================================================Topic: AddDocument() fails if parent Folder has Category with'required' Attributes
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2391778&objAction=viewDiscussion
: LAPI Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Chris_Hall_(linkhanduser1_-_(deleted))
Hi Jeremy,Thanks for your reply, but I tried CreateObjectEx() as well and it also returns the -2474...[big number] status.I eventually got my application working by:1) I create an temporary folder, with no attributes;2) I copy the rights and permissions from the correct destination folder to the temporary folder.3) I create my document within the temporary folder.4) I move the document from the temporary folder to the correct destination folder (it works!)5) I remove the temporary folder.It was a pain to do that and I am considering my release a temporary one, until Opentext fixes the bug in AddDocument.Do you know when will this issue be addressed?Cheers.Mo
Mike_Oliver_(MorningstarUser3_(Delete)_1426757)
When Livelink creates any item through LAPI using CreateObjectEx(), it checks to see if the parent you specify has a category with required attributes. If so, it looks in the "createinfo.requiredAttributes" for the values. If they do not exist, an error is returned. So, you must send in the attribute values with your CreateObjectEx() call.First, what you have to do is call GetObjectAttributes() on the parent, which will return a RecArray with all of the attribute info for the parent.Next, create an assoc with the names/values of the attributes with what you want on the object you are creating.Finally, add this assoc to your createInfo assoc as createInfo.requiredAttributes (createInfo is the assoc that you pass to CreateObjectEx()).Hope this helps.Darryn GrahamMorningstar Systems, Inc.dgraham@morningstarsystems.com866.902.7633 ext 15