Show Method (AliasSearch Object)



This method shows a modal Alias Search Dialog and returns a PIAliasList object. The Aliases in the list can be from 1 or more PI Servers, depending on the search criteria that are specified by the user. If the user presses the cancel button or presses the OK button with no points selected from the search results, then a PIAliasList object with zero members will be returned.



AliasSearch.Show([vSearchContext] [, tsOptions])

The Show method syntax has these parts:





One does not need to declare the AliasSearch object before invoking the show method. The AliasSearch object is global to the application. AliasSearch.Show can be called immediately from anywhere in the application. The AliasSearch object cannot be created with the New operator.


vSearchContext is a variant that is used to specify an optional search context.  vSearchContext can be path to a server or module.  For example, vSearchContext can be set to the following character strings.


The above search context paths are valid provided that localhost is in the Known Servers Table and that Reactor13 is a valid PIModule on the Server localhost.  Alternatively, vSearchContext can be set to a Server object or a PIModule object.

Unless the search context is marked as disabled in tsOptions, the search context can be changed by the user on the Alias Search dialog.

If the vSearchContext argument is omitted, then the last search context will be used from the last time that the Alias Search dialog was shown.  If the Alias Search dialog is shown for the first time, then the search context will be set to a connected PI Server.  If the default server is connected or if no PI Servers are connected, then the default server will be preferentially chosen as the context.  


tsOptions are optional Alias Search options specified as a bitmask.



One or more of the following tag search options can be applied. Multiple options are specified by adding the options together.





Do not allow the user to change the search context specified in vSearchContext.  ERR_NOSEARCHCONTEXT is thrown if vSearchContext is not passed and tsoptDisableSearchContext is specified.



Only 1 alias can be selected from the search results when this option is specified.



When the alias search dialog is shown, the user can specify search criteria. The last search criteria that were specified are preserved the next time that the Alias Search dialog is shown.

The last search results are also preserved each time that the Alias Search dialog is shown with the following exception. If tsoptDisableSearchContext is specified, any PI points that are not associated with the passed search context are removed from the search results.


After a search completes, the first alias in the search results is selected by default.


Trappable Errors





This error is raised if an invalid option is specified in tsOptions.


No search context was specified.  If tsoptDisableSearchContext is specified, a search context must be specified.

Enabling Operational Intelligence