You are viewing limited content. For full access, please sign in.

Question

Question

Using SDK to read Template Information

asked on July 6, 2017

Hello,

Using SDK, there is a way to get the detail information of a template such as field names, data type, length, list value ... ? 

Thanks much,

An

 

 

0 0

Answer

SELECTED ANSWER
replied on July 6, 2017

here are the basics

        Dim MyTemplate As TemplateInfo = Template.GetInfo(sTemplateName, CurSession)
        For iFieldIndex As Integer = 1 To MyTemplate.FieldCount
            Dim CurrentField As FieldInfo = MyTemplate.Item(iFieldIndex)
            Dim sName As String = CurrentField.Name
            Dim bMultiValue As Boolean = CurrentField.IsMultiValue
            Dim iLen As Integer = CurrentField.Length
            Dim bRequired As Boolean = CurrentField.IsRequired
            Select Case CurrentField.FieldType
                Case FieldType.Blob

                Case FieldType.Date

                Case FieldType.DateTime

                Case FieldType.List
                    Dim CurrentList As FieldItemList = CurrentField.GetItemList()
                    Dim lstListField As List(Of String) = CurrentList.ToList()
                Case FieldType.LongInteger

                Case FieldType.Number

                Case FieldType.ShortInteger

                Case FieldType.String

                Case FieldType.Time

            End Select
        Next

 

2 0

Replies

replied on July 7, 2017

Thanks so much Bert. That's what I need. Have a nice day!  :)))

 

0 0
replied on July 7, 2017 Show version history

If  "MyTemplate.Item(iFieldIndex)" doesn't work, try "MyTemplate.Fields.ElementAt(iFieldIndex)" :))

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.