Pretty confident I figured this out.Select P.* From MHGROUP.Projects PInner Join MHGROUP.Projects P2 On P2.Tree_ID = P.Tree_ID And P2.SubType = 'work'Inner Join MHGROUP.DocMaster D On D.DocNum = P2.DocNumWhere P.PRJ_Name = 'Email' And P.EMAIL Is NullBecause there is both a workspace record, and a workspace folder record (Email) in Projects, in order to get back to DocMaster, you have to join in Projects a second time, using an alias, joining the two on Tree_ID and you can then get back to DocMaster via DocNum on the second Projects table, P2 in this case.So the Above query would list those Email folders with no email value, where you could then use to get C1ALIAS, C2ALIAS.Hence:Update MHGROUP.Projects Set EMAIL = D.C1ALIAS + '.' + D.C2ALIASFrom MHGROUP.ProjectsInner Join MHGROUP.Projects P1 On P1.Tree_ID = MHGROUP.Projects.Tree_ID And P1.SubType = 'work'Inner Join MHGROUP.DocMaster D On D.DocNum = P1.DocNumWhere MHGROUP.Projects.PRJ_Name = 'Email' And MHGROUP.Projects.EMAIL Is Null
In the query above, don't you need to use the PROJECT_ITEMS table to get from projects to documents? E.g. for a project in the projects table, you need to join in the project_items table on the project id, and then join the docmaster table on the item_id and version of the project_items table vs the docnum and version of the docmaster table.This in addition to getting all the folders that belong to a specific workspace first, of course.Through the API, I think you can do a query on all documents of a given workspace easily enough, and then specify what type you want. You can't, however, currently use the API to query for empty values, so you'd have to test those one by one.
My mistake! I had just run several queries for documents in folders and I thought you needed documents, not just folders. Worksite also has a COM interface (iManage.dll) which you can use. It contains among others functions to search for folders, documents and workspaces, and they are returned to you as objects with properties and such. You can get a workspace object, and then go through its collection of documentfolders to check if their EmailPrefix property has the correct value, and adjust it if necessary.This is a cleaner method, but not always the most practical of course if you're well versed in SQL and not in the API of a certain application, because unlike APIs, SQL and relational databases have at least the same grammar. However, programming against the API is a lot safer, and if I remember correctly, directly editing SQL tables invalidates WorkSite's warranty. It's not always possible to avoid it, but if we can avoid it for our customers, we do so.
HiI am haviing a similar issue.I would like to know where the document resides in an Imanage Workspace using SQL (similar to "where used" in Desksite). I understand that the PROJECTS table as PRJ_PID field which references the top-level folder.I don't know how to query the tables which will give me the full workspace path and returns the pathI have a number of documents that are linked to a number of folder workspaces - similar to below.Folder A (document A resides here) Folder Sub A Folder Sub B (document A resides here) Folder Sub CIs it possible using SQL that I can find where the document resides (using the full path)So it would tell me that document A is located af Folder A ANDDocument A is located At Folder A\Folder Sub A\Folder Sub B
Yes, I used that API to create a Worksite add-in to rename document descriptions. A user can select 2 or more documents and either replace or append text to a document description. See here: Is there an official document that describes this particular point, where you describe how using T-SQL on the back-end invalidates the warranty or support contract? Thanks.I don't know how it would be avoidable, especially within the first few months of implementation where not all the business processes are completed ironed out.