Hi,
Issue:
I added “UserName” to the customers form IDO Collection list as a secondary.
When I try to quarry User information, I am not sure why I cannot get more than six properties; returned from my secondaryIDOCollection.
When I try to filter on the user via ID or Name, and try to return a property like CreatedDate, CreatedBy,etc. It returns an empty string. When I dig down, I find the number of properties and it does not contain the all the ones I see when viewing the collection properties TreeList. When I am trying to return is the subcollection “UserGroupMaps”
The goal is to control the primaryIDOCollection’s Save/Delete/Update state by reading the “UserGroupMaps” and checking to see if that group exists and making the correct adjustments.
Versions:
Syteline 8.03.11
Doc-Trak 2013
Why:
I have a requirement to prevent a group of users from making any changes to Customers; they currently have read-only access. Doc-Trak Scan / Attachments do not function correctly unless you have all the grants assigned to the parent form. This will not work for me as Customer records are control via another group of users for compliance reasons.
I even called LakeCo; they informed me that this is normal and there is no bug in the system. I could request a customization and create a second authorization model but that would be out of my pocket.
Code:
Sub CheckUsers()
Dim UserNamesCollection As IWSIDOCollection = ThisForm.GetSecondaryIDOCollection(2)
Dim bValue As Boolean = false 'Return Refresh Status
bValue = UserNamesCollection.Refresh() 'Refresh with filter settings
Application.ShowMessage(bValue.toString())
'UserNamesCollection.filter = "UserId = '" & "330" & "'" 'Use LakeCo UserID Variable (Username)
'UserNamesCollection.FilterEnabled = True 'Enable Filter for Collection
bValue = UserNamesCollection.Refresh() 'Refresh with filter settings
'UserNamesCollection.ExportCollection(False, "C:AMTSL8Export.csv", False)
Application.ShowMessage("Filter:" & UserNamesCollection.Filter.toString() _
& vbLf _
& "CollectionName: " & UserNamesCollection.GetDisplayedObjectName() _
& vbLf _
& "# of Entries:" & UserNamesCollection.GetNumEntries().toString())
If UserNamesCollection.First() Then
Dim i as Integer = 0
Dim i_property as Integer = 0
Dim bIsNext As String
Dim iNumEntries As Long
Dim propertyMsg As String
For i = 0 To UserNamesCollection.GetNumEntries
If i >= 5 then Exit Sub
Application.ShowMessage("The system navigated to the first record." _
& vbLf _
& "The index number is now: " _
& UserNamesCollection.GetCurrentObjectIndex() _
& vbLf _
& "UserID: " & UserNamesCollection.GetCurrentObjectProperty("UserId").toString() _
& vbLf _
& "NumberOfProperties: " & UserNamesCollection.GetNumProperties().toString() _
& vbLf _
& "CreateDate: " & UserNamesCollection.GetCurrentObjectProperty("CreateDate") _
& vbLf _
& "EditLevel: " & UserNamesCollection.GetCurrentObjectProperty("EditLevel").toString() _
& vbLf _
& "UserGroupMaps: " & UserNamesCollection.GetCurrentObjectProperty("UserGroupMaps").toString())
'Loops though all the properties of the collection
iNumEntries = UserNamesCollection.GetNumProperties()
Do While i_property < iNumEntries
propertyMsg = propertyMsg & " Property " & (i_property + 1) & ": " & _
UserNamesCollection.GetPropertyName(i_property ) & vbLf
i_property = i_property + 1
Loop
Application.ShowMessage("Total number of properties in this collection: " & iNumEntries & vbLf & vbLf & "Properties are: " & vbLf & propertyMsg)
bIsNext = UserNamesCollection.Next().ToString 'Move to the next item
Application.ShowMessage("IsNext: " & bIsNext) 'Did it move?
Next i
End If
End Sub
Alternatives:
If anyone have an alternative that allows me to keep my restricted from access, but still allows doc-trak to function correctly that information would be great.