Skip to main content

Search function

I am currently writing a script that i would like to search the entire database for terms. I utilized the history of a current project  but the code manually adds each field. is there a shortcut to add all fields from the database?
 
task.AddFieldToInc "ACCOUNT_NUMBER"
task.AddFieldToInc "DESCRIPTION"task.AddFieldToInc "DATE"
task.AddFieldToInc "NAME"

Brian Element Thu, 03/22/2018 - 09:02

Try

task.IncludeAllFields

This will copy all the fields from the source file.

Brian

profit814 Fri, 03/23/2018 - 17:35

When i make the edit above, i get "Error on line 433- Object does not support this propery or method.i listed the full function below. Thanks for the help.
 
' Data: SearchFunction Search Dim db As database Dim task As task Dim dbName As String  Set db = Client.OpenDatabase(filename) Set task = db.Search task.IncludeAllFields task.RecordFilesPrefix = "Search for Key Terms" task.PerformTask "plug ", 0, 0, 1 dbName = "Search for Key Terms" Client.OpenDatabase(dbName) Set task = Nothing Set db = NothingEnd Function
 
 

Brian Element Sat, 03/24/2018 - 07:47

In reply to by profit814

Hi, I just looked at what is allowed in the Search function and you have to list all the fields.  Unfortunately you can't use the task.IncludeAllFields in this function like you can in other functions.  I just sent an email to IDEA asking for this option but for now you will have to list the fields.

Brian