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)
Unable to add additional properties to a folder
Noble
bI try to add additional properties to a folder, but I get the error message:
AddMatterToWorkspace: Message - [AdditionalProperty ][Add ]Access is denied.
AddMatterToWorkspace: Source - iManage.NRTDMS.2
So it doesn't work.
This is supposed to work from WorkSite Web and the method uses the onlogged web session like this:
IManSession imSession = (IManSession)sessionContext.Dms.Sessions.ItemByIndex(1);
AddMatterToWorkspace(imSession, matterId);
And this is the code that fails in the method AddMatterToWorkspace(IManSession, String):
docFolder = (IManDocumentFolder) imDocs.ItemByIndex(i);
docFolder.AdditionalProperties.Add("iMan___28",matterId);
docFolder.Update();
The session's user is the person who is logged into and tries to create a new workspace in WorkSite Web.
Suggestions?
Regards,
Willem
Find more posts tagged with
Comments
guf
Hi Willem,
Still using Interwoven ?
The problem is that according to the documentation AdditionalProperties are Read-only. I haven't looked for another way to do it as I will have the problem soon.
If you find a solution I might be interrested.
Have you tried using the workspace generator ?
Cheers
Guillaume
jny
This error usually indicates that the target attribute you're trying to add already exists in the document folder profile. Therefore, what you should do is to verify the existence of the target attribute. If it does exist, replace it by removing the old before adding the new. Like so:
[CSharp]
// Check whether the target attribute currently exists
if(ofolder.AdditionalProperties.ContainsByName(sattribute)==true)
{
// Remove the existing attribute before adding a new one
ofolder.AdditionalProperties.RemoveByName(sattribute);
}
// Add matter id to the profile
ofolder.AdditionalProperties.Add(sattribute, sval);
// Commit changes to the server
ofolder.Update();
jny
Alternatively, you may update the attribute value in the AdditionalProperties collection, like so:
// Assuming sattribute has the attriubte id, and sval has the new value
ofolder.AdditionalProperties.ItemByName(sattribute).Value = sval;
ofolder.Update();
scrollbar.jpg
Noble
Yes, that seems to work.
Thanks.
Noble
Hi Guillaume.
Yes, still working witn Interwoven.
The class AdditionalProperties has an Add-method you can use.
Like this:
if (docFolder.AdditionalProperties.ContainsByName("iMan___28"))
{
docFolder.AdditionalProperties.RemoveByName("iMan___28");
}
docFolder.AdditionalProperties.Add("iMan___28",matterId);
docFolder.Update();
That works for me.
)
(I've also created a method for automatic generation of matter id's if you're interested)
Regards,
Noble