Home
TeamSite
IManWorksite Update methods and problems with APPNAME
rikrak99
Hi,
Can anyone tell me what the difference is between the Update methods on IManWorkspace?
There are three:
void Update();
void UpdateAll(string file, ref object errors);
IManProfileUpdateResult UpdateAllWithResults(string file);
The reason I'm asking this is that at the moment I have Windows service code that uses UpdateAllWithResults, but this produces an error in the IManage logs (DmsLog.txt):
SQL State: 22001, Native Error: 8152, Msg: [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
This error occurs during the call to UpdateAllWithResults. It looks like a row is being inserted into DOCHISTORY table, but failing because my application's name is 33 characters long, whereas the APPNAME field on DOCHISTORY is only 32 characters long.
So, I suppose I need to be able to change the AppName value that IManage uses, or use a different Update method.
I should point out that I'm new to iManage, and this is not my codebase, so I might be asking a really noddy question here!
Extracted C# code:
//Get database object
m_databse = database;
//Create workspace under first databse among listed Databses
m_workspace = m_databse.CreateWorkspace();
//set workspace's name property
m_workspace.Name = name;
//set workspace's Description property
m_workspace.Description = description;
//Set SubType for WorkSpace
m_workspace.SubType = "WORK";
//Update Workspace information in database
string filePath = Path.GetTempFileName();
m_workspace.UpdateAllWithResults(filePath);
//Delete the temp file from disk
File.Delete(filePath);
Find more posts tagged with
Comments
rikrak99
RESOLVED!
Ha! I think I've sussed it out...
In order to explicitly set the Application Name value I've used the ApplicationName property on the IManDMS interface:
this._dms = new ManDMS();
this._dms.ApplicationName = "MyApplication";
Without the second line the Application Name would default to the name of the running application, which in my case was 33 characters long. For example : "Company.ProductName.MyApplication"
This caused all sorts of problems with:
IManWorkspace.UpdateAllWithResults()
IManDocument.CheckInWithResults()
IManDocument.Checkout()