Hello,
Has anyone knowledge of a possibility to change the owner of a tree structure via LAPI?
The applying of permission to a tree with LAPI does work. However I cannot find a way to do this also for a owner change.
Thank you.
Alin
Don't know if you ever got a reply to this, but I use the following code to change the owner of an object using LAPI. Change "UserID" to "GroupID" if you want to change the owner group:
Private Shared Function ChangeOwner(ByVal con As LAPI.Connection, ByVal newuserid As Integer, ByVal dataid As Integer) As Boolean
Dim doc As LAPI_DOCUMENTS = New LAPI_DOCUMENTS(con.Session) Dim attrs As LLValue = (New LLValue).setAssocNotSet
If doc.GetObjectInfo(0, dataid, attrs) <> 0 Then Throw New LAPIException(String.Concat("An error occurred while running GetObjectInfo in ChangeOwner.", con.GetErrorMsg)) End If
attrs.add("UserID", newuserid) If doc.UpdateObjectInfo(0, dataid, attrs) <> 0 Then Throw New LAPIException(String.Concat("An error occurred while running UpdateObjectInfo in ChangeOwner.", con.GetErrorMsg)) End If Return True
End Function
Hi,
If you want to avoid coding you can use the WebReports NODEACTION sub-tag to do bulk updates on the owner.
Thanks,Lee.
From: eLink Entry: LAPI Forum [mailto:lapi@elinkkc.opentext.com] Sent: Wednesday, December 22, 2010 11:17 AMTo: eLink RecipientSubject: Change Owner via LAPI to multiple objects?
Change Owner via LAPI to multiple objects?
Posted by alison.bilton@highways.gsi.gov.uk (Alison, Bilton) On 2010/12/22 05:13
If doc.GetObjectInfo(0, dataid, attrs) <> 0 Then Throw New LAPIException(String.Concat("An error occurred while running GetObjectInfo in ChangeO! wner.", con.GetErrorMsg)) End If
[To post a comment, use the normal reply function]
Topic:
Forum:
LAPI Forum
Livelink Server:
knowledge-wlweb01