BC25 Modern Full-Text Search with dynamic TableRelations throws "An unexpected error occurred after a database command was cancelled. Page Select has to close."
Please include the following with each issue:
1. Describe the bug Typing in fields with dynamic TableRelations results in an unexpected error. When switching to "old search" the behaviour is as excpected - the Select MiniPage shows all the results When switching to "Modern search" the Select page does not show up and typing in anything will result in an error
2. To Reproduce (Source Code in "AL") Given:
-
Field with Dynamic TableRelation, e.g. field(13; "Postal Code"; Code[20]) { Caption = 'Postal Code', Comment = 'PLZ'; DataClassification = CustomerContent; TableRelation = IF ("Country Code" = const('')) "Post Code" where("Country/Region Code" = const('DE')) else IF ("Country Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country Code")); ValidateTableRelation = false; }
-
Modern Search is active
-
Start typing in the page field
Result: After a few seconds (or when hitting Enter) the Error is shown:
If requesting support, please provide the following details to help troubleshooting:
Error message:
An unexpected error occurred after a database command was cancelled.
Page Select has to close.
SQL error message:
Full-Text Search is not installed, or a full-text component cannot be loaded.
Internal session ID:
94138539-f7ee-47eb-9073-101e306f180f
Application Insights session ID:
bb5a8ce8-47f4-4467-b410-60f5056feb95
Client activity id:
9f9f975e-09aa-56cd-ceda-60b4cea3152d
Time stamp on error:
2024-10-15T15:17:36.6082471Z
User telemetry id:
5963e1f4-57e2-4f9e-8898-73ee6644ea58
table 50100 "Test Table"
{
DataClassification = ToBeClassified;
fields
{
field(1; ID; Integer)
{
DataClassification = ToBeClassified;
AutoIncrement = true;
}
field(13; "Postal Code"; Code[20])
{
Caption = 'Postal Code', Comment = 'PLZ';
DataClassification = CustomerContent;
TableRelation = IF ("Country Code" = const('')) "Post Code" where("Country/Region Code" = const('DE')) else IF ("Country Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country Code"));
ValidateTableRelation = false;
}
field(14; City; Text[50])
{
Caption = 'City', Comment = 'Ort';
DataClassification = CustomerContent;
TableRelation = IF ("Country Code" = const('')) "Post Code".City where("Country/Region Code" = const('DE')) else IF ("Country Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Country Code"));
ValidateTableRelation = false;
}
field(15; "Country Code"; Code[3])
{
Caption = 'Country Code', Comment = 'Ländercode';
DataClassification = CustomerContent;
TableRelation = "Country/Region";
ValidateTableRelation = true;
}
}
keys
{
key(Key1; ID)
{
Clustered = true;
}
}
}
page 50100 "TestPage"
{
ApplicationArea = All;
Caption = 'TestPage';
PageType = Card;
SourceTable = "Test Table";
layout
{
area(Content)
{
group(General)
{
Caption = 'General';
field("Country Code"; Rec."Country Code")
{
ToolTip = 'Specifies the value of the Country Code field.', Comment = '%Ländercode';
}
field("Postal Code"; Rec."Postal Code")
{
ToolTip = 'Specifies the value of the Postal Code field.', Comment = '%PLZ';
}
field(City; Rec.City)
{
ToolTip = 'Specifies the value of the City field.', Comment = '%Ort';
}
}
}
}
}
Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
3. Expected behavior Same behaviour as old search: Showing results while typing OR: Error message ist always shown when Full-Text Search is not installed. Fields with a fixed TableRelation are working just fine. (Newest Docker image has the same behaviour as the installed counterpart on a server)
4. Actual behavior
Error is thrown (see above)
5. Versions:
- AL Language: v14.0.1161190
- Visual Studio Code:
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045
- Business Central: Version: DE Business Central 25.0 (Platform 25.0.24618.0 + Application 25.0.23364.24652) (Docker and Real Installation)
- List of Visual Studio Code extensions that you have installed:
- Operating System:
- [X] Windows
- [ ] Linux
- [ ] MacOS
Final Checklist
Please remember to do the following:
-
[X] Search the issue repository to ensure you are reporting a new issue
-
[X] Reproduce the issue after disabling all extensions except the AL Language extension
-
[X] Simplify your code around the issue to better isolate the problem
The same.
Modern search is using full text search. You need to install it in order to use it in on-prem. See documentation below:
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-table-field-text-search#install-full-text-search-on-the-database-on-premises-only
yes, but it's missing on the BC Images and the SQL Setup Installation Center doesn't work for containers, for long as I know.
Also: Is there a reason for why this works for normal TableRelations anyways?
I would suggest to open a bug on the AL:Go repository as this repository is only for the AL language compiler and related tools.
You can also use the official support routes:
Open a support request to CSS through the PartnerSource portal
Open a bug in Collaborate
Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company
As for why it works for normal table relations, this is a runtime issue. Most likely the runtime tries to access code related to full text search when using a dynamic table relation, perhaps as an optimization and the database throws the exception. But again this is outside of th scope of this repo.