Search function

4 posts / 0 new
Last post
profit814
Offline
Joined: 03/18/2018 - 17:12
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's picture
Brian Element
Online
Joined: 07/11/2012 - 19:57

Try

task.IncludeAllFields

This will copy all the fields from the source file.

Brian

profit814
Offline
Joined: 03/18/2018 - 17:12

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's picture
Brian Element
Online
Joined: 07/11/2012 - 19:57

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