VB Script functionality is no longer recommended and may be removed in a future release. It is strongly recommended that Unity Scripts be used instead of VB Scripts.
You can use a VB Script query to communicate with the external database and identify the Keyword Values that display when the Keyword Type drop-down list is selected during indexing or re-indexing.
-
Create the VB Script. For VB Script configuration information, see VB Scripts Configuration. Required parameters include the following:
-
The VB Script must programmatically provide Keyword Values or a way to obtain them.
-
The VB Script must programmatically provide a way to return all of the Keyword Values required by the Keyword Data Set in the desired sort order.
-
The script that satisfies the External Keyword Data Set should implement the following entry point:
Sub GetKeywordDataSetRecords(filterValue, context, results) End Sub
-
The first parameter, filterValue, indicates the string to replace the _filter_ value in the select string.
Note:If you have selected the Retain Wildcard Symbols in “_filter_” Search String option, wildcard characters ( * ) will be replaced with a percentage character ( % ) and retained in the filterValue string.
-
The second parameter, context, contains three properties:
KeywordTypeID- Retrieves the Keyword Type number of the Keyword Type used in the data set.
KeywordTypeName- Retrieves the Keyword Type name of the Keyword Type used in the data set.
UserName- Retrieves the User Name of the current user.
-
The last parameter, results, retrieves the Keyword Values. It has the following methods:
BeginRow( )- Begins a new row in the result set. The caller should call this once for every row that is returned to satisfy the Keyword Set results.
AddData (“keyvaluechar”, keyvalue)- Adds a column value into the result set.
EndRow ( )- Ends a row in the result set.
-
Note:Ensure that your VB Script adheres to External Keyword Data Set Consideration requirements. See VB Script Considerations for External Keyword Data Sets for details. For more information on creating a valid VB Script, contact your first line of support.
When you configure the VB Script, ensure that you select External Keyword Data Set from the Visible Scope dialog box. See Visible Scope.
-
-
From the Keyword Data Set Configuration dialog box, select the External check box and click the External button.
The External Keyword Data Set Configuration dialog box is displayed.
-
Select VB Script. Select the appropriate VB Script from the drop-down list.
Note:
You must have configured the VB Script in order for it to display in the list. See VB Scripts Configuration.