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
updateObjectInfo for forms
abrown
Is it possible to use the updateObjectInfo for a form to change its creationDate, its createdBy user, and its owner?As in:copyItemInfo.setInteger("UserID", srcItemInfo.toInteger("UserID"));copyItemInfo.setDate("CreateDate", srcItemInfo.toDate("CreateDate"));copyItemInfo.setInteger("CreatedBy", srcItemInfo.toInteger("CreatedBy"));copyItemInfo.setString("Comment", "Original URL = http://" + serverNameString + cgiString + "/open/" + Integer.toString(srcItemInfo.toInteger("ID")) + " " + srcItemInfo.toString("Comment"));status = documents.UpdateObjectInfo( copyItemVolID, copyItemObjID, copyItemInfo);I don't want to (or need to) change the form contents, but I am making a copy of the form (a move is not permitted) and I want the copy to reflect (some of) the properties of the original. I can't seem to make updateObjectInfo change those three property values. Am I missing something, is this a bug, or is this fully operating as expected?Thanks, Allen Brown
Find more posts tagged with
Comments
Todd_Pinel
I think what you should probably do in your code is something similar to the following:LLValue copyItemInfo = (new LLValue()).setAssocNotSet();int userID = 111;LLValue tempValue = (new LLValue()).setInteger(userID);//add llvalue representing your userId to your assoccopyItemInfo.add("UserID", tempValue);//do the same with the remaining fields now//update objectstatus = documents.UpdateObjectInfo(copyItemVolID,copyItemObjID,copyItemInfo);instead of using the "set" methods for different datatypes what you want to do is ADD each peice of info to your assoc.also I'm not sure but it looks like you are using C# and if so you will want to watch how you add the date to your assoc as well.
abrown
Thanks for the suggestion, Todd.Tried it. No joy. I was using the snippet that I included in my post and it worked perfectly well for all other item types (at least all the ones I encountered - I believe I skip a lot of stuff that can't be copied - though I recreate Projects as Folders of the same name). I am wondering if Forms are peculiar beasts for LAPI, partly because of their connection to their templates, who fills them in, and potentially, their relation to underlying custom tables.My current thinking is that I'll skip these adjustments - though I do create a nickname for the item that references the original object ID of the source of the copy, so someone with enough permissions can always go back to the original items.This work is part of a major effort to segregate intellectual property by business unit in preparation for large-scale divestitures.Thanks again.