Lookup Scripts

Overview

 

The methods for lookup query and results processing are accessed through the LookupScript class. Lookup scripts are accessed on individual lookups defined on Advanced Indexing->Lookups->Add->Options->Miscellaneous. To enable scripting on individual lookups, check the "Enable Lookup Scripting" checkbox and press the Open Script Editor button.

 

 

LookupScript Class

 

ProcessPreviewQuery Method

The ProcessPreviewQuery method is called when running a preview of a Lookup query in Lookup configuration. It is called before the actual lookup runs to allow the Key values for the query to be manipulated. Return false from this method to stop the Lookup from running.

Parameters:

Direction Parameter Type Description
IN lookup ILookupDefinition The definition of the lookup being previewed
IN/OUT query IDictionary<string, object> The values for the Key Fields defined on the Lookup keyed by the Index Field name

Returns:

True or False

 

ProcessBatchRecordQuery Method

The ProcessBatchRecordQuery method is called when running a Lookup query for Batch level fields. It is called before the actual lookup runs to allow the Key values for the query to be manipulated. Return false from this method to stop the Lookup from running.

Parameters:

Direction Parameter Type Description
IN batch IBatch The batch the lookup is being run on
lookup ILookupDefinition The definition of the lookup being processed
IN/OUT query IDictionary<string, object> The values for the Key Fields defined on the Lookup keyed by the Index Field name

Returns:

True or False

 

ProcessFolderRecordQuery Method

The ProcessFolderRecordQuery method is called when running a Lookup query for Folder level fields. It is called before the actual lookup runs to allow the Key values for the query to be manipulated. Return false from this method to stop the Lookup from running.

Parameters:

Direction Parameter Type Description
IN batch IBatch The current batch
folder IFolder The folder the lookup is being run on
lookup ILookupDefinition The definition of the lookup being processed
IN/OUT query IDictionary<string, object> The values for the Key Fields defined on the Lookup keyed by the Index Field name

Returns:

True or False

 

ProcessDocumentRecordQuery Method

The ProcessDocumentRecordQuery method is called when running a Lookup query for Document level fields. It is called before the actual lookup runs to allow the Key values for the query to be manipulated. Return false from this method to stop the Lookup from running.

Parameters:

Direction Parameter Type Description
IN batch IBatch The current batch
folder IFolder The current folder
document IDocument The document the lookup is being run on
documentRecordIndex int The index of the document record the lookup is being run on
lookup ILookupDefinition The definition of the lookup being procesed
IN/OUT query IDictionary<string, object> The values for the Key Fields defined on the Lookup keyed by the Index Field name

Returns:

True or False

 

ProcessPreviewResults Method

The ProcessPreviewResults method is called after a preview of a Lookup query has been run in Lookup configuration. The results of the lookup are available in a DataTable object allowing the data to be manipulated before index fields are populated with the return fields. Return false from this method to clear the result set that gets sent back from the lookup.

Parameters:

Direction Parameter Type Description
IN lookup ILookupDefinition The definition of the lookup being previewed
query IDictionary<string, object> The values for the Key Fields defined on the Lookup keyed by the Index Field name
IN/OUT results System.Data.DataTable The query results

Returns:

True or False

 

ProcessBatchRecordResults Method

The ProcessBatchRecordResults method is called after a Lookup query has been run for Batch level fields. The results of the lookup are available in a DataTable object allowing the data to be manipulated before index fields are populated with the return fields. Return false from this method to clear the result set that gets sent back from the lookup.

Parameters:

Direction Parameter Type Description
IN batch IBatch The batch the lookup was processed for
lookup ILookupDefinition The definition of the lookup being processed
query IDictionary The values for the Key Fields defined on the Lookup keyed by the Index Field name
IN/OUT results System.Data.DataTable The query results

Returns:

True or False

 

ProcessFolderRecordResults Method

The ProcessFolderRecordResults method is called after a Lookup query has been run for Folder level fields. The results of the lookup are available in a DataTable object allowing the data to be manipulated before index fields are populated with the return fields. Return false from this method to clear the result set that gets sent back from the lookup.

Parameters:

Direction Parameter Type Description
IN batch IBatch The current batch
folder IFolder The folder the lookup was processed for
lookup ILookupDefinition The definition of the lookup being procesed
query IDictionary The values for the Key Fields defined on the Lookup keyed by the Index Field name
IN/OUT results System.Data.DataTable The query results

Returns:

True or False

 

ProccessDocumentRecordResults Method

The ProcessDocumentRecordResults method is called after a Lookup query has been run for Document level fields. The results of the lookup are available in a DataTable object allowing the data to be manipulated before index fields are populated with the return fields. Return false from this method to clear the result set that gets sent back from the lookup.

Parameters:

Direction Parameter Type Description
IN batch IBatch The current batch
folder IFolder The current folder
document IDocument The document the lookup was processed for
documentRecordIndex int The index of the document record the lookup was processed for
lookup ILookupDefinition The definition of the lookup being procesed
query IDictionary The values for the Key Fields defined on the Lookup keyed by the Index Field name
IN/OUT results System.Data.DataTable The query results

Returns:

True or False

 

 

Keywords: PSIcapture Lookup Scripts, How to use scripts PSIcapture Lookups, Script Lookups in PSIcapture

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.