73
from https://github.com/microsoft/AL/issues/6163

--

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!
Category: Development
STATUS DETAILS
Planned
2022 Release Wave 2
Ideas Administrator

Thank you for this suggestion! We are shipping this in 2022 release wave 2. You can already now try it out in insider VSIX builds.

Instead of e.g., 
SourceTableView = where("Source Type" = const(18));

it will be possible to use the option name, i.e.,<br>
SourceTableView = where("Source Type" = const(Database::Customer));

Best regards,
Business Central Team

Comments

D

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

D

Yes, this is an inconsistency and would make code much more readable.

Category: Development

D

https://github.com/microsoft/AL/issues/6229

Category: Development