Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Creating a new version of a document with ImportNewVersionCmd
TrinMat
Has anyone got this working? If so can you please provide some examples. I cannot get the command to execute.
Find more posts tagged with
Comments
killerclown
I have the same problem.
When trying to do an importnewversion, I get a messagebox, stating that >operation can be performed on 1 Document only<
My code belo :
public string ****()
{
IManDMS server = new ManDMSClass();
IManSession session = null;
IManDatabases databases = null;
IManDatabase hest = null;
session = server.Sessions.Add("BB_DMS");
session.TrustedLogin();
databases = session.Databases;
hest = databases.ItemByName("Legal");
try
{
ImportNewVersionCmd cmdVer = new ImportNewVersionCmd();
IManDocument replacedoc = hest.GetDocument(5939495,1);
ContextItems context = new ContextItemsClass();
context.Add("IManExt.ImportNewVersionCmd.Document", replacedoc);
context.Add("IManExt.Checkin.FileName", "c:\\test.txt");
context.Add("IManExt.OpenCmd.NoCmdUI", true);
cmdVer.Initialize(context);
cmdVer.Update();
cmdVer.Execute();
bool brefresh = (bool)context.Item("IManExt.Refresh");
if (brefresh == true)
{
}
}
catch
{
}
return "Y";
}
robcom
SNAP: I've just got the same message:
*Operation can be performed on 1 document only*
Anyone know this one? I'll keep digging.
RobCom
Arwin
I actually use the IManDocument.CheckIn function with the CheckInAsNewVersion option for this, that is in the imanage.dll. You can get more detailed information referencing a ChekinResults object in there as well.
robcom
I quickly reverted to using the IManDocument.CheckIn function with the CheckInAsNewVersion, as I have used in the past. My code just needed to do a temporary CheckOut of the original version first (to a different directory), then clean these files up later on.
RobCom
killerclown
Arwin... You are the man !
Thanks !!!!!