Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are moving to new internal systems and i'm going to have to add several columns to all of our content center libraries. I'm trying to do this via ilogic so i don't have to open a few hundred libraries to do this. I can loop through the families, but it keeps throwing errors adding a column. The error is that clear as mud 'the parameter is incorrect'. It's at the TableColumns.Add line...what am i missing here?
Public Sub Main()
Dim oContentCenter As ContentCenter
oContentCenter = ThisApplication.ContentCenter
Dim a As ContentTreeViewNode
a = oContentCenter.TreeViewTopNode
Call LoopGetFromTreeView(a)
End Sub
Private Sub LoopGetFromTreeView(oContentTreeViewNode As ContentTreeViewNode)
Dim oContentTreeViewNodeLoop As ContentTreeViewNode
Dim strPath As String
strPath = oContentTreeViewNode.FullTreeViewPath
Dim strFam As String
strFam = oContentTreeViewNode.DisplayName
Dim strExport As String
strExport = oContentTreeViewNode.DisplayName
Dim oContentFamily As ContentFamily
For Each oContentFamily In oContentTreeViewNode.Families
'do something here
MessageBox.Show(oContentFamily.DisplayName)
MessageBox.Show("2")
oContentFamily.TableColumns.Add("Item Group", "Item Group [Custom]", ValueTypeEnum.kStringType)
MessageBox.Show("3")
'modify cell
Dim oRow As ContentTableRow
For Each oRow In oContentFamily.TableRows
oRow.Item("Item Group").Value = "Purchase Lot -100030"
Next
'save change
Call oContentFamily.Save
Next
For Each oContentTreeViewNodeLoop In oContentTreeViewNode.ChildNodes
Call LoopGetFromTreeView(oContentTreeViewNodeLoop)
Next
End Sub
Solved! Go to Solution.