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)
Problem deleting MyMatters shortcuts
GlenW
I have a routine that gets a user's MyMatters folder (MMF) clears all of the shortcuts and then repopulates them based on data we pull from our systems.
When I go to clear the MMF, I am getting an "Access Denied" error. The session is created using NRTADMIN and is the same credentials I use to create workspaces and do other Admin functionality. NRTADMIN has full rights.
Any ideas?
Thanks,
Glen
Code Below
-------------------------------
Private Function FillMyMattersFolderAll(ByVal DaysHistory As Integer) As WorkspaceOperationResults
Dim mmfResults As New WorkspaceOperationResults
'> Clear My-Matters Folder if a full clear and refill is desired
If CurrentMMF Is Nothing Then
Throw New ApplicationException("My-Matters folder not available for " & sourceEmployee.FullNameFirstLast)
Else
CurrentMMF.SubFolders.Clear()
CurrentMMF.Update()
End If
'> Populate MyMatters Folder
'> Get list of shortcuts for user's My-Matters folder.
Dim shortcuts As iManage.WorkSite.IManWorkspaceShortcuts
shortcuts = DirectCast(CurrentMMF.SubFolders, iManage.WorkSite.IManWorkspaceShortcuts)
If DaysHistory > 0 Then DaysHistory = DaysHistory * -1
Using dc As New WHdbDataContext(DMSGlobals.Warehouse_Conn)
Dim mtrs = From m In dc.MyMattersDTEs _
Where m.UserID = sourceEmployee.UserID _
And m.LastEntry >= Today.AddDays(DaysHistory) _
And m.MatterStatus <= 5 _
Select m.UserID, m.ClientNumber, m.MatterNumber Distinct
For Each mtr In mtrs
Try
If GetWorkspace(mtr.ClientNumber.Trim, mtr.MatterNumber.Trim) = True Then
shortcuts.AddNewWorkspaceShortcutInheriting(CurrentWS)
Else
mmfResults.ErrorsList.Add("Workspace for C/M# " & mtr.ClientNumber.Trim & "-" & mtr.MatterNumber.Trim & _
" not found for employee " & sourceEmployee.FullNameFirstLast & ".")
End If
Catch ex As Exception
mmfResults.ErrorsList.Add("Error creating shortcut for C/M# " & mtr.ClientNumber.Trim & "-" & mtr.MatterNumber.Trim & _
" for employee " & sourceEmployee.FullNameFirstLast & "." & _
vbNewLine & "Error: " & ex.Message)
End Try
Next
mmfResults.OperationSuccessful = True
End Using
Return mmfResults
End Function
Find more posts tagged with
Comments
GlenW
In futher experimentation, I found that either using the "clear" command on the MMF.Subfolders collection OR stepping through the shortcuts by index would delete 4 shortcuts and THEN throw the access denied error.
Strange.
So, I experimented with the possibility that there was a bug in Interwoven that didn't properly handle the changes in the collection as items were deleted from it. I came up with the code below:
'> Get list of shortcuts for user's My-Matters folder.
Dim shortcuts As iManage.WorkSite.IManWorkspaceShortcuts
shortcuts = DirectCast(CurrentMMF.SubFolders, iManage.WorkSite.IManWorkspaceShortcuts)
Do While shortcuts.Count > 0
shortcuts.RemoveByIndex(1)
shortcuts.Refresh()
Loop
This seems to work like a charm. Unless someone else has another explanation, it seems I may have stumbled across a bug.
Would love to hear other opinions.
Thanks,
Glen