SetTag
Realizes tagID - field name association from within a macro via SmartContext.
Compatibility
Available as of IDEA version 9.1.1
Syntax
SetTag(tagID as String, fieldName as String)
Parameters
tagID
tagID to be associated to fieldName
fieldName
column name to be associated to tagID
Example
Dim sPrimaryInputfile As String
Sub Main
'Get the name of the database
sPrimaryInputFile = SmartContext.PrimaryInputfile
'Tagging
AssignAnotherTagsPrimaryInputFile
End Sub
Sub AssignAnotherTag(ByVal databaseName)
Dim helper As Object
Dim tagID As String
Dim columnName As String
Set oTM = oMC.TagManagement
Set helper = oTM.Tagging(databaseName)
'tagID - field associations
AssignTag helper, "DebtorClearingCode", "SOURCE"
AssignTag helper, "CustomerName", "DESCRIPTION"
AssignTag helper, "CustomerCode", "USER"
'Save associations
helper.Save
'Release objects
Set helper = Nothing
Set oTM = Nothing
Exit Sub
Sub AssignTag(ByVal helper as Object, ByVal tagID as String, ByVal columnName as String)
'Assign tagID to columnName
helper.Set Tag tagID, columnName
'Log information
SmartContext.Log.LogMessage "SetTag succeeded for tag - field: " & tagID " - " & columnName
End Sub