Skip to content

KVSFCYFindRecordManagement#

Procedures#

FindRecordByDescription(Text, Integer, Text, Text) : Integer#

Summary: Finds records by searching through description and key fields using intelligent search algorithms including exact matches, partial matches, wildcards, and similarity-based matching, providing flexible record discovery for user input scenarios with comprehensive search strategies and extensibility through integration events.

procedure FindRecordByDescription(var Result: Text; TableID: Integer; SearchText: Text; RecordView: Text): Integer

Parameters:

  • Result: Text variable (passed by reference) that will contain the primary key value of the found record, providing the identifier for the discovered record that matches the search criteria for subsequent record retrieval or processing operations.
  • TableID: Integer value specifying the table identifier in which to search for records, determining the target table for record discovery and enabling table-specific field mapping and search logic configuration.
  • SearchText: Text value containing the search string used for record matching, supporting various search patterns including exact matches, partial descriptions, wildcard expressions, and similarity-based text matching for flexible record discovery.
  • RecordView: Text value containing the record view filter string to apply during search operations, enabling pre-filtered record sets and scoped search operations within specific record subsets for improved search precision and performance.

Returns: Integer value indicating the number of matching records found (0 for no matches, 1 for single match, or higher count for multiple matches), providing information about search result quantity for result handling and user interface feedback.

Events#

OnAfterFindRecordByDescriptionAndView(Text, Integer, RecordRef, FieldRef, Integer, Text, Integer) :#

Summary: Integration event that is raised after attempting to find a record by description and view when standard search methods have not found a match, providing an extension point for implementing custom search algorithms and alternative record discovery methods with access to search context and ability to return match results.

[IntegrationEvent(false, false)]
local procedure OnAfterFindRecordByDescriptionAndView(var Result: Text; TableID: Integer; var RecRef: RecordRef; SearchFieldRef: FieldRef; SearchFieldNo: Integer; SearchText: Text; var MatchCount: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYFindRecordManagement", 'OnAfterFindRecordByDescriptionAndView', '', false, false)]
local procedure DoSomethingOnAfterFindRecordByDescriptionAndView(var Result: Text; TableID: Integer; var RecRef: RecordRef; SearchFieldRef: FieldRef; SearchFieldNo: Integer; SearchText: Text; var MatchCount: Integer)
begin
end;

Parameters:

  • Result: Text variable (passed by reference) that should contain the primary key value of the found record if a match is discovered by the extension, providing the identifier for subsequent record retrieval operations.
  • TableID: Integer value specifying the table identifier being searched, enabling table-specific custom search logic and field mapping for extension implementations.
  • RecRef: RecordRef variable (passed by reference) pointing to the table being searched with applied filters and view settings, providing direct record access for custom search operations.
  • SearchFieldRef: Array of FieldRef variables containing references to the search fields (No., Description, additional fields), enabling access to field properties and values for custom search algorithms.
  • SearchFieldNo: Array of Integer values containing the field numbers for search fields, providing field identification for custom search logic implementation.
  • SearchText: Text value containing the original search string input by the user, enabling custom text analysis and alternative matching algorithms in extension code.
  • MatchCount: Integer variable (passed by reference) that should be set to the number of matching records found by the extension (0 for no matches, 1 for single match, or higher count for multiple matches), providing result quantity information.

OnBeforeFindRecordByDescriptionAndView(Text, Integer, RecordRef, FieldRef, Text, Text, Integer, Boolean) :#

Summary: Integration event that is raised before starting the standard record search by description and view, providing an extension point for implementing custom search logic that can bypass or enhance the default search algorithms with access to all search parameters and ability to handle the entire search operation.

[IntegrationEvent(false, false)]
local procedure OnBeforeFindRecordByDescriptionAndView(var Result: Text; TableID: Integer; var RecRef: RecordRef; SearchFieldRef: FieldRef; SearchText: Text; RecordView: Text; var MatchCount: Integer; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYFindRecordManagement", 'OnBeforeFindRecordByDescriptionAndView', '', false, false)]
local procedure DoSomethingOnBeforeFindRecordByDescriptionAndView(var Result: Text; TableID: Integer; var RecRef: RecordRef; SearchFieldRef: FieldRef; SearchText: Text; RecordView: Text; var MatchCount: Integer; var IsHandled: Boolean)
begin
end;

Parameters:

  • Result: Text variable (passed by reference) that should contain the primary key value of the found record if the extension handles the search operation, providing the record identifier for subsequent operations.
  • TableID: Integer value specifying the table identifier in which to search for records, enabling table-specific custom search implementations and logic routing.
  • RecRef: RecordRef variable (passed by reference) pointing to the table with applied record view filters, providing direct record access for custom search operations and filter manipulation.
  • SearchFieldRef: Array of FieldRef variables containing references to the configured search fields (No., Description, additional fields), enabling field access and custom search field logic in extensions.
  • SearchText: Text value containing the user-provided search string, enabling custom text processing and alternative matching strategies in extension implementations.
  • RecordView: Text value containing the record view filter string applied to limit search scope, providing context for scoped search operations and filter-aware custom logic.
  • MatchCount: Integer variable (passed by reference) that should be set by the extension to indicate the number of matching records found, enabling result quantity reporting for user interface feedback.
  • IsHandled: Boolean variable (passed by reference) that should be set to true by the extension if it has completely handled the search operation, preventing execution of standard search logic.

OnBeforeFindRecordContainingSearchString(Integer, RecordRef, Text) :#

Summary: Integration event that is raised before performing a wildcard search for records containing the search string anywhere in the search fields, providing an extension point for modifying search filters or implementing additional search criteria for contains-based record discovery operations.

[IntegrationEvent(false, false)]
local procedure OnBeforeFindRecordContainingSearchString(TableID: Integer; var RecRef: RecordRef; RecFilterFromStart: Text): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYFindRecordManagement", 'OnBeforeFindRecordContainingSearchString', '', false, false)]
local procedure DoSomethingOnBeforeFindRecordContainingSearchString(TableID: Integer; var RecRef: RecordRef; RecFilterFromStart: Text)
begin
end;

Parameters:

  • TableID: Integer value specifying the table identifier being searched, enabling table-specific filter modifications and search logic customization in extension implementations.
  • RecRef: RecordRef variable (passed by reference) with applied filters for contains-based search, allowing extensions to modify search filters, add additional criteria, or implement alternative search strategies.
  • RecFilterFromStart: Text value containing the wildcard filter expression used for contains-based matching (format: '@searchtext'), providing context for filter analysis and modification in extension code.

OnBeforeFindRecordStartingWithSearchString(Integer, RecordRef, Text) :#

Summary: Integration event that is raised before performing a prefix-based search for records starting with the search string in the search fields, providing an extension point for modifying search filters or implementing additional search criteria for starts-with record discovery operations.

[IntegrationEvent(false, false)]
local procedure OnBeforeFindRecordStartingWithSearchString(TableID: Integer; var RecRef: RecordRef; RecFilterFromStart: Text): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYFindRecordManagement", 'OnBeforeFindRecordStartingWithSearchString', '', false, false)]
local procedure DoSomethingOnBeforeFindRecordStartingWithSearchString(TableID: Integer; var RecRef: RecordRef; RecFilterFromStart: Text)
begin
end;

Parameters:

  • TableID: Integer value specifying the table identifier being searched, enabling table-specific filter modifications and search logic customization for prefix-based searches.
  • RecRef: RecordRef variable (passed by reference) with applied filters for starts-with search, allowing extensions to modify search filters, add additional criteria, or implement alternative prefix-matching strategies.
  • RecFilterFromStart: Text value containing the wildcard filter expression used for starts-with matching (format: '@searchtext*'), providing context for filter analysis and modification in extension implementations.

OnGetRecRefAndFieldsNoByType(RecordRef, Integer, Integer) :#

Summary: Integration event that is raised to retrieve the RecordRef and configure search field numbers for a specific table type, providing an extension point for defining custom field mappings and search field configurations for different table types in record discovery operations.

[IntegrationEvent(false, false)]
local procedure OnGetRecRefAndFieldsNoByType(RecRef: RecordRef; TableID: Integer; var SearchFieldNo: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYFindRecordManagement", 'OnGetRecRefAndFieldsNoByType', '', false, false)]
local procedure DoSomethingOnGetRecRefAndFieldsNoByType(RecRef: RecordRef; TableID: Integer; var SearchFieldNo: Integer)
begin
end;

Parameters:

  • RecRef: RecordRef variable pointing to the table being configured, providing access to table structure and field information for search field identification and mapping operations.
  • TableID: Integer value specifying the table identifier for which search field configuration is requested, enabling table-specific field mapping and search strategy customization.
  • SearchFieldNo: Array of Integer variables (passed by reference) that should be populated with field numbers for search operations: [1] = Primary key field (No.), [2] = Description/Name field, [3] = Additional field (e.g., Base Unit of Measure), enabling custom field mapping for different table types.