Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Getting Com exception "[Folders ][ItemByIndex(get) ]Value for "Index" is out of range
narek1
Getting Com exception "[Folders ][ItemByIndex(get) ]Value for "Index" is out of range -- when tried to search templates with name. This is working fine for some templates but for others it's not working.
This issue just started yesterday (we are using this code since 5 years)
We have seen in WorkSite system that all templates exist and also checked same from SQL server using following query
______________________________________________________
select * from mhgroup.projects where subtype = 'template' order by prj_name;
_____________________________________________________
Please find the code where we are getting error
__________________________________________________________
IManDMS dms = new ManDMS();
IManSession session = dms.Sessions.Add("WorkSite Server");
session.Login("UserId", "**********");
IManDatabases databases = session.Databases;
IManDatabase database = databases.ItemByName("Database");
//create profile search object
IManProfileSearchParameters p = dms.CreateProfileSearchParameters();
//create workspace search obejct
IManWorkspaceSearchParameters w = dms.CreateWorkspaceSearchParameters();
w.Add(imFolderAttributeID.imFolderName, "CONTENTIOUS_MA");
w.Add(imFolderAttributeID.imFolderSubtype, "template");
//Getting error in following line
IManWorkspace workspace = (IManWorkspace)database.SearchWorkspaces(p, w).ItemByIndex(1);
I am not understanding what exactly causing this issue. Anyone please suggest what can be done to resolve the issue.
Find more posts tagged with
Comments
guido1
Most likely this is because your indexing service has changed. Probably you are now using IDOL
Certain profile values are handled by IDOL, which then sends results back to the WorkSite app server to process and render back to the client. You have limited API search options when it is routed via IDOL
I'm fairly certain the Name field is one such field that is handled by IDOL. There are several others, documented either in the SDK or Release Notes documentation.
As a workaround you'll have to return all templates and iterate over each one to match by name
Alternatively, and my recommendation if it's sensible for your application, store the ID of the workspace template itself rather than template Name
narek1
Hi
You're spot on, yes the issue is with IDOL index server. Now I have resolved the issue.
Thanks for your help on this.