The code looks good and I’m sure itworks; however, can I just chime in with a short warning?
The CreatedBy field is really an integralpart of the history of your organisation’s knowledge and I’dsuggest that you should have an extremely good reason for overriding it.
For example, if I create a document inLivelink and then some years later I leave the organisation, there is a recordthat I created that document. On the other hand, if someone were to change theCreatedBy field of that document to the person hired to replace me (yes I know,nobody could replace me J ) then it appears that the new person created the document and notme, and s/he may not be too pleased about it. Nor might the auditors, lawyersor compliance officers.
Just something to consider.
Howard
---
Howard Pell
Senior Technical Educator Liaison, SpecialProjects
Open Text Corporation
www.opentext.com
Office: (519) 888-7111 Ext. 2203
Mobile (519) 574-2248
From: eLinkDiscussion: LAPI Discussion [mailto:lapi@elinkkc.opentext.com] Sent: 2009-Apr-27 5:22 PMTo: eLink RecipientSubject: Hey Guy )
Hey Guy )
Posted by todd.pinel@huskyenergy.ca (Pinel, Todd) on 2009/04/27 17:21
In reply to: According to lapi documentation if you obtain the objectinfo by using the call...
Posted by anair@alitek.com (Nair, Appu) on 2009/04/27 14:04
Hey Guy Appu is correct. Just create an assoc and set a key in that assoc named "CreatedBy" to the userid in question and then pass that into UpdateObjectInfo. Heres a C# code snippet: int newUserId = 111222333; //user in question int objectId = 23345677; //object in question LLValue updateInfo = (new LLValue()).setAssocNotSet(); updateInfo.add("createdby", newUserId); LAPI_DOCUMENTS doc = new LAPI_DOCUMENTS(session); if (doc.UpdateObjectInfo(0, objectId, updateInfo) == 0) { //success } else { //failed }
Hello Guys,
Would you please help me in where I am going wrong, I have tried the same way for updating Createby and OwnerID....
I have tried the same in JAVA
/////// ------ Code snippet for updating the createdby and ownerid
UpdateInfo.add("CreatedBy",1000); UpdateInfo.add("UserID",1000); System.out.println(UpdateInfo); int upstat ; upstat = doc.UpdateObjectInfo(parentVol, parentID, UpdateInfo); System.out.println(upstat); if(upstat == 0) { System.out.println("Success");} else { System.out.println("failed");
}
/// ----------- but getting the error message like here below
//////////// ------- error message here below
Exception in thread "main" com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype at com.opentext.api.LLInstance.get(Unknown Source) at com.opentext.api.LLValue.toValue(Unknown Source) at com.opentext.api.LLConnect.unMarshall(Unknown Source) at com.opentext.api.LLConnect.unMarshall(Unknown Source) at com.opentext.api.LLSession.unMarshall(Unknown Source) at com.opentext.api.LAPI_DOCUMENTS.UpdateObjectInfo(Unknown Source) at TEST.main(TEST.java:36)
//////////////////////
Best Regards, Alex
Hi,
Thanks for your response,
I have tried looking logs and KC for the error, but no findings yet.
///UpdateInfo is a LLValue
LLValue UpdateInfo = ( new LLValue() ).setAssocNotSet();
Any suggestions would be helpful..
Thanks and Regards,
Alex
I seem to recall that I had the same problem… to fix it, Idid a work-around by doing a GetObjectInfo to pre-populate UpdateInfo:
private int setfolderrootperms( int volumeID,int nodeID, int usergroupID, int permission, int index, int ugID )
{
.
LLValue Request = (new LLValue() ).setAssocNotSet();
Request.setAssocNotSet();
ret =llDocs.GetObjectInfo( 0, nodeID, Request );
Request.add("UserID", usergroupID );
ret =llDocs.UpdateObjectInfo( volumeID, nodeID, Request );
From: eLink Entry: LAPIForum [mailto:lapi@elinkkc.opentext.com] Sent: Monday, November 29, 2010 7:15 AMTo: eLink RecipientSubject: Would you please help me in where I am going wrong ...
Would you please help me in where I am going wrong ...
Posted by alexander-vishnu.pachipala@ubs.com (Pachipala, Alexander-Vishnu) On 2010/11/29 07:14
/// ----------- b! ut getting the error message like here below
[To post a comment, use the normal reply function]
Topic:
LAPI - Change Created By and Owned By values?
Forum:
LAPI Forum
Livelink Server:
knowledge-wlweb01