01-05-2019 07:47 AM
This is for Act! 21
Trying to retrieve a field descriptor from the history table only to get an error that it does not exist. I'm using the code below:
fdHistoryDateFieldDescriptor = ACTFM.Histories.GetFieldDescriptor("TBL_HISTORY.STARTTIME")
I've also tried START_DATE_TIME and everytime the framework reports that the field does not exist.
Any idea how to get the time displayed by the history item?
T
01-11-2019 12:16 PM
I usually iterate thru all the field descriptor liek this....
cFieldDescrip = GetHistoryFieldDescriptorByName(HostFramework, "STARTDATE")
Public Shared Function GetHistoryFieldDescriptorByDisplayName(ByVal HostFramework As Act.Framework.ActFramework, ByVal sDisplayName As String) As Act.Framework.Histories.HistoryFieldDescriptor '------------------------------------------------------------ ' Check all other fields in the GetNoteFieldDescriptors ' And return the One where sDisplayName = cField1.DisplayName '---------------------------------------------------------------- For Each cField1 As Act.Framework.Histories.HistoryFieldDescriptor In HostFramework.Histories.GetFieldDescriptors() If sDisplayName.ToUpper = cField1.DisplayName.ToUpper Then Return cField1 Exit For End If Next Return Nothing End Function
Hope this helps
-- Jim Durkin
01-11-2019 01:25 PM
Thank you Jim. That is a great way to get the names of the descriptors. In the past, we had to put TBL_HISTORY. in front in order to get the descriptor. However, when retrieving the history descriptors, supplying the field name only seems to do the trick.
Have a good weekend.
T