This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Fire Template from Code

How can I fire a template from code.

dbObject.ExecuteTemplates() does nothing.

I know there is this a way with sql (exec vid_InsertForHandleObject_0 'ExecuteTemplates', 'Person', '', @ProcID=newid) but I do not want to call sql from code, it should actually be possible from code directly?

Parents
  • I've used this script in the past (v6.x)

    Public Sub ExecuteTemplate(ByVal tableName As String, ByVal columnName As String, ByVal whereClause As String)
    Dim f As ISqlFormatter = Connection.SqlFormatter
    Dim tableEntries As IColDbObject = Connection.CreateCol(tableName)
    tableEntries.Prototype.WhereClause = f.CleanWhereClause(whereClause)
    tableEntries.Prototype(columnName).IsDisplayItem = True
    tableEntries.Load()
    For Each entry As IColElem In tableEntries
    Dim dbObject As ISingleDbObject = entry.Create
    Dim column As IDbColumn = dbObject.Columns(columnName)
    column.ExecuteTemplate()
    dbObject.Save()
    Next
    End Sub

    Worth a shot!

    HTH
    Kunal
Reply
  • I've used this script in the past (v6.x)

    Public Sub ExecuteTemplate(ByVal tableName As String, ByVal columnName As String, ByVal whereClause As String)
    Dim f As ISqlFormatter = Connection.SqlFormatter
    Dim tableEntries As IColDbObject = Connection.CreateCol(tableName)
    tableEntries.Prototype.WhereClause = f.CleanWhereClause(whereClause)
    tableEntries.Prototype(columnName).IsDisplayItem = True
    tableEntries.Load()
    For Each entry As IColElem In tableEntries
    Dim dbObject As ISingleDbObject = entry.Create
    Dim column As IDbColumn = dbObject.Columns(columnName)
    column.ExecuteTemplate()
    dbObject.Save()
    Next
    End Sub

    Worth a shot!

    HTH
    Kunal
Children
No Data