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

Question

Question

Return record properties of search results as string

asked on October 14, 2015

Hi there,

I would like to request for an example on how to return the record properties of records (from search) as strings. Below is an example of what I need to happen (plus the name of the columns that I need):


Dim Search As LFSearch = me.Database.CreateSearch()
Search.Command = "search string for record" 
Search.BeginSearch(True)
Dim SearchHits As ILFCollection = Search.GetSearchHits()
If SearchHits.Count > 0 Then
For Each Hit As LFSearchHit In SearchHits
    Dim Doc As LFDocument = Hit.Entry
    Dim RecProp As LFRecordProperties = Doc.RecordProperties
    Dim RPFieldval1 As String = RecProp "Cutoff"
    Dim RPFieldval2 As String = RecProp "Retention Schedule"
    Dim RPFieldval3 As String = RecProp "Final Disposition Action"
    Dim RPFieldval4 As String = RecProp "Filing Date"
    Dim RPFieldval5 As String = RecProp "Cutoff Instruction"
    Dim RPFieldval6 As String = RecProp "Cutoff Instruction Type"
    Dim RPFieldval7 As String = RecProp "Creation Date"
    Dim RPFieldval8 As String = RecProp "Last Modified"
Next

Any example or similar will be very useful and much appreciated. Thank you.

Capture.JPG
Capture.JPG (25.68 KB)
0 0

Answer

SELECTED ANSWER
replied on October 22, 2015

I haven't tried this code, so this is more of an outline rather than a working example:

Dim search As LFSearch
' Run your search here
Dim listingParams As LFSearchListingParams = New LFSearchListingParams
listingParams.AddStandardColumn(Column_Type.COLUMN_TYPE_FILINGDATE)
Dim results As ILFSearchResultListing = search.GetSearchResultListing(listingParams, 100)

Dim numRows As Integer = results.RowCount
For i As Integer = 1 To numRows
  Dim filingDate As String = results.DatumByColTypeAsString(i, Column_Type.COLUMN_TYPE_FILINGDATE)
  Console.WriteLine("Filing date: {0}", filingDate)
Next

 

0 0

Replies

replied on October 22, 2015

Hi there,

 

Just making a follow up if such a scenario is possible.

 

Thank you.

0 0
replied on October 22, 2015

Hi Michael,

 

Thank you for this, I got the idea. One last thing, can you please check if I got all of the column names right?

 

"Cutoff" - COLUMN_TYPE_CUTOFF_CRITERION(?)

"Retention Schedule" - COLUMN_TYPE_RETENTION_SCHEDULE

"Final Disposition Action" - COLUMN_TYPE_DISPACTION

"Filing Date" - COLUMN_TYPE_FILINGDATE

"Cutoff Instruction" - COLUMN_TYPE_CUTOFFCYCLE(?)

"Cutoff Instruction Type" - COLUMN_TYPE_CUTOFFELIG(?)

"Creation Date" - COLUMN_TYPE_CREATEDATE

"Last Modified" - COLUMN_TYPE_LATEST_REVISION(?)

0 0
replied on October 22, 2015

For "Cutoff", specify COLUMN_TYPE_ISCUTOFF. For "Cutoff Instruction Type", use COLUMN_TYPE_CUTOFF_CRITERION. For "Last Modified" use COLUMN_TYPE_LASTDATE. You may need to experiment a little to get what you want.

1 0
replied on October 23, 2015

Hi Michael,

 

Thank you very much for your help. I got the exact result that I need.

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

Sign in to reply to this post.