Code on this form enumerates Field Descriptors via Loan.Session.Loans.FieldDescriptors object as follows:
Try
Dim lst As New System.Collections.Generic.List(Of EllieMae.Encompass.BusinessObjects.Loans.FieldDescriptor)
Dim fd As EllieMae.Encompass.BusinessObjects.Loans.FieldDescriptor
' 1. enumerate standard fields
For Each fd In Loan.Session.Loans.FieldDescriptors.StandardFields
lst.Add(fd)
Next
' 2. enumerate virtual fields
For Each fd In Loan.Session.Loans.FieldDescriptors.VirtualFields
lst.Add(fd)
Next
' 3. enumerate custom fields
For Each fd In Loan.Session.Loans.FieldDescriptors.CustomFields
lst.Add(fd)
Next
' 4. create complete export text
Dim sb As New System.Text.StringBuilder
sb.Append("Type" & vbTab & "FieldID" & vbTab & "Format" & vbTab & "Len" & vbTab & _
"MultiInstance" & vbTab & "Description" & vbCrLf)
For Each fd In lst
Dim sFieldType = "Standard"
If fd.IsVirtualField Then sFieldType = "Virtual"
If fd.IsCustomField Then sFieldType = "Custom"
Dim sMultiInstance = ""
If fd.MultiInstance Then sMultiInstance = fd.InstanceSpecifierType.ToString()
Dim sLine As String
sLine = sFieldType & vbTab & fd.FieldID & vbTab & fd.Format.ToString() & vbTab & _
fd.MaxLength & vbTab & sMultiInstance & vbTab & fd.Description & vbCrLf
sb.Append(sLine)
Next
' 5. ask for output file
Dim sfd As New System.Windows.Forms.SaveFileDialog
sfd.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"
sfd.CheckPathExists = True
sfd.FilterIndex = 0
If sfd.ShowDialog() = System.Windows.Forms.DialogResult.OK And _
sfd.FileName.Length > 0 Then
' 6. save file
Using fs As System.IO.FileStream = New System.IO.FileStream( _
sfd.FileName, System.IO.FileMode.Create, System.IO.FileAccess.Write)
Using sw As System.IO.StreamWriter = New System.IO.StreamWriter(fs)
sw.Write(sb.ToString())
End Using
End Using
' 7. success message
MsgBox("File saved: " + sfd.FileName, 64, "Success")
' 8. Open file with Notepad
Shell("Notepad.exe """ & sfd.FileName & """", 1)
Else
' error - file was not specified
MsgBox("Please specify output file.", 48, "Error")
End If
Catch ex As Exception
' unexpected error
MsgBox("Error: " + ex.Message, 48, "Error")
End Try