--
Describe the bug
When setting up SourceTableViews, TableRelations, and so on - that relate to other tables by table IDs (or, far less frequently, specify codeunit IDs to run, etc.) - we still have to use the raw integer ID, which is ugly, opaque, error-prone, and incompatible with what I hear is the plan by MS to get rid of object IDs entirely (eventually!).
--
To Reproduce
Try to make a page that shows Custom Report Selections for Customers only.
You have to enter it like so:
SourceTable = "Custom Report Selection";
SourceTableView = where("Source Type" = const(18));
--
Expected behavior
Ideally, we should be able to specify the table ID via its name in the Database:: namespace or similar, like we can in actual AL code:
SourceTable = "Custom Report Selection";
SourceTableView = where("Source Type" = const(Database::Customer));
Please consider making this possible in all such where() expressions, and for all object types. Thanks!
Comments
Hi,We've seen this in 2022 release wave 2 (BC21) - would be great if this was also available to use RunPageLink with const(database:: ) rather than const(id).eg:RunPageLink = "Table No." = const(Database::"MyTable")rather than:RunPageLink = "Table No." = const(50000)Thanks.
Category: Development
Yes, this is an inconsistency and would make code much more readable.
Category: Development
https://github.com/microsoft/AL/issues/6229
Category: Development
Business Central Team (administrator)
Instead of e.g.,
Best regards,
Business Central Team