Changing TableRelation has no impact
Modifiying the TableRelation in a existing table has no impact on the TableRelation - the original (old) relation will continied to be used.
Sample Code:
tableextension 85005 CustExt extends Customer
{
fields
{
modify("Location Code")
{
TableRelation = "Post Code";
}
}
}

AL Language: 3.0.150570 (tested it with 4.0.209944, too) BC: 14.0.34251.0
Maybe i'm doing something wrong.
Hi! In the docs https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-tablerelation-property it specifies that the extension is only extended and not overwritten. That behavior is in line with what you are reporting. Does it make sense?
Hi atoader, sure makes sense - i've choosen this easy example because i tried to modify an existing tableRelation with a filter, but the filter didn't work. the documentation said, that it would work or do i interprete the doc wrong.
so i'll give a another try an report it here
Thanks! I want to underline that the original filter will be applied and the filter you add. Please also test it on the latest release. As stated in our FAQ, on GitHub, we can only accept issues on the latest release, issues on other releases must go through the standard support channels.
This issue has been closed because it needs more information and has not had recent activity. Please open a new issue if you believe this has not been resolved and reference the current issue.
Hi @atoader, this issue seems has not been resolved in BC v19
I need to do this TableRelation change in my project, but it doesn't work and it still appliying the original standard TableRelation, even though it compiles:
tableextension 50000 "BOM Component Ext" extends "BOM Component"
{
fields
{
modify("Parent Item No.")
{
// Add "Non-Inventory" Items for having BOM Components
// It doen't work at BC v19!
TableRelation = Item."No." where(Type = filter(Inventory | "Non-Inventory"));
}
}
}
QUESTION.- In BC standard, a "Non-Inventory" Item can be part of a "BOM Component" of a Parent-Item, BUT, why can't has its own "BOM Component" list
table 90 "BOM Component"
{
Caption = 'BOM Component';
DrillDownPageID = "Assembly BOM";
LookupPageID = "Assembly BOM";
fields
{
field(1; "Parent Item No."; Code[20])
{
Caption = 'Parent Item No.';
NotBlank = true;
TableRelation = Item WHERE(Type = CONST(Inventory));
}
field(2; "Line No."; Integer) { ... }
field(3; Type; Enum "BOM Component Type") { ... }
field(4; "No."; Code[20])
{
Caption = 'No.';
TableRelation =
IF (Type = CONST(Item)) Item WHERE(Type = FILTER(Inventory | "Non-Inventory"))
ELSE
IF (Type = CONST(Resource)) Resource;
[ ... ]
}
[ ... ]
}
[ ... ]
}
BC Version: ES Business Central 19.1 (Plataforma 19.0.31889.34054 + Aplicación 19.1.31886.34210)
AL Language VSCode extension: v8.3.570094