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)
Cannot search for folders using the Matter Number
MikeatBDB
Hi
I have written a test sub to display a list of folders that have a default profile to a particular matter. The search I have writtem does not work for the matter but using the same code I can seach for folder names? Can anyone give me some pointer on this
Here my Code
Sub GetFolderList(strMatter As String, strDMSServer As String, striManageDb As String)
Dim oDMS As IManDMS
Dim oSession As IManSession
Dim oWorkArea As IManWorkArea
Set oDMS = New ManDMS
Set oSession = oDMS.Sessions.Add(strDMSServer)
oSession.TrustedLogin
Set oWorkArea = oSession.WorkArea
Dim oFolders As IManFolders
Dim oFolder As IManFolder
Dim oFolderSearchParams As IManFolderSearchParameters
Dim oManStrings As ManStrings
Set oManStrings = New ManStrings
oManStrings.Add striManageDb
Set oFolderSearchParams = oDMS.CreateFolderSearchParameters
oFolderSearchParams.Add imFolderCustom2, strMatter
'oFolderSearchParams.Add imFolderName, "*" & strMatter & "*"
Set oFolders = oWorkArea.SearchFolders(oManStrings, oFolderSearchParams)
Dim strList As String
Dim objval As Object
Dim iLoop As Integer
For Each oFolder In oFolders
strList = strList & oFolder.Name & vbCrLf
For Each objval In oFolder.AdditionalProperties
strList = strList & objval.Value & vbCrLf
Next
strList = strList & vbCrLf
Next
MsgBox strList
End Sub
Thanks
Mike Healy
Bircham Dyson Bell
Find more posts tagged with
Comments
jny
A document folder object does not actually have an associated profile as it does for an IManWorkspace (which inherits the IManProfiledFolder Interface) or an IManDocument (which inherits the IManProfiledContent Interface). A workspace or a document object actually has an IManProfile. A document folder object does not have an IManProfile but rather it relies on IManAdditionalProperties to store folder attributes, i.e., Client/Matter metadata. Unfortunately, a method of searching document folders by folder profile field values is currently unsupported. The imFolderCustom1, 2, and 3 represent the name-value pairs added as folder CustomProperties thus you will not be able to find the target matter value (which is stored in the AdditionalProperties) through search attributeid imFolderCustom2.
What you could do is search for document folders by folder name, owner, etc., then iterate through the AdditionalProperties collection of each of the returned folders to match the target matter value. Like so:
[CSharp]
// Assuming that oFolders represent the results returned by SearchFolders method.
for(int i=1; i<=oFolders.Count; i++)
{
// Check the individual folder
IManFolder oFldr = oFolders.ItemByIndex(i);
// Check the AdditionalProperties Collection of the folder
IManAdditionalProperties oAPs = oFldr.AdditionalProperties;
// Check for Custom2 (matter) AdditionalProperty value
if(oAPs.ContainsByName("IMan___26")) // IMan___26 represents CUSTOM2
{
MessageBox.Show(oAPs.ItemByName("IMan___26").Value);
Environment.Exit(0);
}
}
Edited by jny on 12/15/04 11:44 AM (server time).